<td>¥
<apex:outputText value="{0,Number,,000.00}">
<apex:param value="{!sd.Total_Price__c}"/>
</apex:outputText>
</td>
<apex:outputText value="{0,number,currency}">
自带美元符号
或者
(Apex Class 中的方法):
private string ConvertToMoneyFormat(decimal price){
if (price == null || Math.abs(price) < 0.005) return '$0.00';
String s = (price.setScale(2) + (price >= 0 ? 0.001 : -0.001)).format();
return '$' + s.substring(0, s.length() - 1);
}
基本结果表现为:11 ----> $11.00
1111 ---> $1,111.00
1111.1 ---> $1,111.10
1111.111 ---> $1,111.11