0

For USA - $ 1,000,000,000.00 For India - Rs 1,00,00,000.00

I Know this is possible by using java script regular expressions.If we are using java script,we need to write regex for each country.But I want to know that "Is it possible by using salesforce predefined methods(if any) ?"

3
  • Are those currency field? or you want to display currency based on logged in users location? Commented Dec 4, 2015 at 9:36
  • Thanks for your response.It is a currency type field.Our application is force.com site.Please tell me how to display currency symbol and currency format based on logged in users location?
    – Manoj
    Commented Dec 4, 2015 at 9:42
  • But what about the conversion, as $ 1,000,000,000.00 is not equal to Rs 1,00,00,000.00.
    – Saroj Bera
    Commented Dec 4, 2015 at 13:12

1 Answer 1

0

Here is a knowledge article from Salesforce to do it

https://help.salesforce.com/apex/HTViewSolution?id=000176332&language=en_US

<apex:page > 
    <script type="text/javascript"> 
        var __sfdcSessionId = '{!GETSESSIONID()}'; 
    </script> 
    <script src="../../soap/ajax/27.0/connection.js"    type="text/javascript"></script> 
    <script type="text/javascript"> 
        window.onload = setupPage; 
        function setupPage() { 
            var result = sforce.connection.getUserInfo(); 

            alert(result); 
            document.getElementById('label').innerHTML=result.currencySymbol; 

            log("Output:" + output); 
    } 
    </script> 
    <div id="label"> </div> 
</apex:page>
2
  • By using above code ,we are getting only symbol of currency.But I need to change the format of currency. Ex: USA - $ 1,000,000,000.00 For India - Rs 1,00,00,000.00
    – Manoj
    Commented Dec 4, 2015 at 11:46
  • This can by done by dynamically passing last parameter in outputText <apex:outputText value="{0, number, 000,000.00}"> salesforce.stackexchange.com/questions/44748/… Commented Dec 4, 2015 at 12:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .