Find your content:

Search form

You are here

Removing trailing decimal in email


I am displaying attributes that are of type Number (18,0) in an email using a Visual Force template. I am referenced the attributes in the template in the normal way. However, they are displayed as:


Whereas I want them displayed as


Any ideas what I have to do here?

Attribution to: dublintech

Possible Suggestion/Solution #1

Maybe like in that example from salesforce:

<apex:outputText value="{0, number, integer}">
    <apex:param value="{!someDouble}" />

Attribution to: Sergej Utko

Possible Suggestion/Solution #2

Check the expression functions reference, you should find something that fits.

{!ROUND(myObject__c.myField__c,0)} maybe?

Or even {!SUBSTITUTE(TEXT(myObject__c.myField__c), '.0', '')}

But if it's VF page template - mast0r's answer is the preferred way as it gives you more control (my formulas can still be used if you have plaintext email for example).

Attribution to: eyescream
This content is remixed from stackoverflow or stackexchange. Please visit

My Block Status

My Block Content