+ Start a Discussion
jega_gmailjega_gmail 

Cuurency Format API in Java Application

In java development, which api is best for getting the organisation currency format details(like currency symbol, thousand separator,decimal separator).  Using this api, i need to display the data in my application  with same format present in the Salesforce .

 

$ 1.000,00

jega_gmailjega_gmail

Any help.....

 

Sanchit DuaSanchit Dua

using java.text.NumberFormat with a method named: getCurrencyInstance() method is used to obtain a NumberFormat object for applying locale specific currency formatting on a number.

 

Let me know if you need more help regarding this.

jega_18jega_18

 How to get Salesforce organisation currency using JAVA API. using result value, i can display the numbers in same format.

 

can you please provide sample for it..

 

Here my sample code:

 

NumberFormat nf = NumberFormat.getCurrencyInstance(new Locale(userInfo.getUserLocale()));
Currency c = nf.getCurrency();
System.out.println("Symbol:" + c.getCurrencyCode());