Try using apex:outputField
, it would do the formatting for you based on your locale.
Unfortunately its not possible with apex:outputText
and apex:param
. Here is a similar idea.
There was a comment in the idea which could be helpful but would need bit of modification as per requirement:
Option 1: Standard
<apex:outputText value="{0, number, ###,##0.00}">
<apex:param value="{!Opportunity.Amount}"/>
</apex:outputText> </span>
result : 100,000.00
Option 2: Custom formulas
<span>
{!IF(Opportunity.Amount < 0,
"-",
"") &
IF(ABS(Opportunity.Amount) >= 1000000,
TEXT(FLOOR(ABS(Opportunity.Amount) / 1000000)) & ".",
"") &
IF(ABS(Opportunity.Amount) >= 1000,
RIGHT(TEXT(FLOOR(ABS(Opportunity.Amount) / 1000)), 3) & ".",
"") &
RIGHT(TEXT(FLOOR(ABS(Opportunity.Amount))), 3) & "," &
IF(MOD(ABS(Opportunity.Amount) , 1) * 100 < 10,
"0" & TEXT(ROUND(MOD(ABS(Opportunity.Amount), 1), 2) * 100),
TEXT(MIN(ROUND(MOD(ABS(Opportunity.Amount) , 1), 2) * 100, 99))
)}
</span>
Result: 100.000,00