Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How is this possible?

I would assume a VisualForce email template would by default display it to the number of decimal places it is defined as?

How in this instance can it display a value that is stored to 6 decimal places, to 13 decimal places?

enter image description here

Email Template code:

    <p style="padding: 10px 30px 10px 30px; margin: 10px;">
        <b>{!relatedTo.Blah__UtilisationPercentage__c}</b><br />
share|improve this question
Can you share some of your Visualforce code and maybe a screenshot of your field definition please? – Andrew Fawcett Feb 13 '14 at 9:46
I've tried to do this. The image has come out unreadably small, but it's fine if you open it in a new tab. Thanks. – finisterre Feb 13 '14 at 10:08
No problem, I think I've spotted your problem, give it a go. :-) – Andrew Fawcett Feb 13 '14 at 10:09
up vote 3 down vote accepted

Salesforce numeric values are actually stored as generic decimal types internally, i suspect by making a raw/direct binding to the field your simply exposing this value unformatted. The recommended approach for outputting field values is to use apex:outputField, this will handle the correct formatting and localisation of the value (commas, thousand separators). Try this...

<apex:outputField value="{!relatedTo.Blah__UtilisationPercentage__c}"/>

A read-only display of a label and value for a field on a Salesforce object. An apex:outputField component respects the attributes of the associated field, including how it should be displayed to the user

share|improve this answer
Thanks. Tried this. Works! The HTML part of my template now displays to 6 DP. Interestingly, I notice that the plain text part of the template, which is still using the old method e.g. Utilization: {!relatedTo.Blah__UtilisationPercentage__c displays 100% as 100.0%. So there seems to be inconsistent behaviour here. – finisterre Feb 13 '14 at 10:21
@finisterre please upvote and mark as answered if that helps you ,so that its beneficial for other users . – Mohith Shrivastava Feb 13 '14 at 10:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.