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:
18.0
16.0
Whereas I want them displayed as
18
16
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}" />
</apex:outputText>
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 https://salesforce.stackexchange.com/questions/5478