I have a requirement to set the value based on the locale. I will get the locale either en_US
or fr_FR
String locale = object.getLocale(); //
Then based on the locale I need to define the currency. The currency format I need is defined under.
Language Example Notes
Canadian French 123.456.789,99 $ symbol is a suffix,'comma' for decimal
Canadian English $123,456,789.99 symbol is a prefix,'dot' for decimal
Currently I have form attributes which I directly set the values in my java class.
...
Form form = new Form();
// Stub data for generating a graph.
formBean.setCurrOne("123.54");
formBean.setCurrTwo("456.33");
....//before I set those attributes I need to place a check
// for locale and format the currency accordingly.
Can you please help me with the format. Also there is a difference of ,
and a .
in the currency format.
org.springframework.format.number.CurrencyFormatter
ANy example? – Marylouisemaryly