You need to sign in to do that
Don't have an account?
Wingu1
Visualforce templates - problema with merge field
I'm sending receipts through Salesforce and I'm merging the amount value of an opportunity with the template. I have a problem with the decimals. In Salesforce the amounts show two decimals but in the template only one. I don't know what the problem might be. Any help will be very useful.
Thank you
Hey! Why don't you try the outputfield tag? That one will use the same format as in Salesforce.
If that doesn't work for you, let me know and I can give you another idea.
JD
Thanks JD, we tried this and it didn't work, do you have an alternative way?
Thank you
A solution from Salesforce Premier Support.
<apex:outputlabel value="{!ROUND((opportunity.Amount/ 1000)*1000, 2)}" />
JD
Thank you JD, unfortunately this didn't work either...
Best!
Carolina
You have to be doing something wrong then. No offence!
Do you want to paste your code here?
JD
This is the part of the code that shows the amount:
<tr><td width="324" valign="top"><p><strong>Total </strong></p></td>
<td width="325" valign="top"><p align="center"><strong>${!Opportunity.Amount}</strong><strong></strong></p></td>
</tr>
Thank you!
Solution 1:
<td width="325" valign="top"><p align="center"><strong><apex:outputField value="{!opportunity.amount}"/></strong><strong></strong></p></td>
You might not like how this output if your organization is using multi-currencies.
Solution 2:
<td width="325" valign="top"><p align="center"><strong><apex:outputText>${!ROUND((opportunity.Amount / 1000)*1000, 2)}</apex:outputText></strong><strong></strong></p></td>
Solution 3:
<td width="325" valign="top"><p align="center"><strong><apex:outputlabel value="{!ROUND((opportunity.Amount / 1000)*1000, 2)}" /></strong><strong></strong></p></td>