You need to sign in to do that
Don't have an account?

How do I show a variable as currency?
Here are the parts I am using.
public Double totalDeposit { get; set;} {totalDeposit = 0.0;}
for(SFDC_520_QuoteLine__c mql : [Select s.Unit_Net_Price__c,s.Qty_Ordered__c,s.Product2__r.Fee_Type__c From SFDC_520_QuoteLine__c s]) { if(mql.Optional_Item__c==false && (mql.Product2__r.Fee_Type__c=='One Time Setup' || mql.Product2__r.Fee_Type__c=='Monthly Fee') ) { totalDeposit += mql.Unit_Net_Price__c * mql.Qty_Ordered__c; } }
<apex:outputText value="{!totalDeposit}"/>
Yes. I have done a similar thing in another language. You will have to do a nested if statements (since we cant do Switch case here.) and use all String functions. I can post the snippet of code here -
String myCurrency = "10000"; // Whatever you get from your Code
String myFinalCurrency;
if(myCurrency.length() > 4) {
// Split it from 3rd number and add comma
}
.....so onAll Answers
One way to do it will be type casting it into String and prefixing it with dollar sign and adding commas in the String.
Regards
Mukul
Yes. I have done a similar thing in another language. You will have to do a nested if statements (since we cant do Switch case here.) and use all String functions. I can post the snippet of code here -
String myCurrency = "10000"; // Whatever you get from your Code
String myFinalCurrency;
if(myCurrency.length() > 4) {
// Split it from 3rd number and add comma
}
.....so on