I am not sure if the same question is asked by any other. I have not seen this question in stackoverflow so far, hence posting the same.
I have a requirement where I need to format the numbers based on the currency.
Let me explain the above table to give you more context of my question. For UnitedStates, numbers are formatted as USD976,543.21, here the currency symbol is USD which is placed in the front before numbers. This is little different for fr-FR locale, here € symbol is placed after the digits.
All my formatting is happening in the front end and not the backend. I am giving a format in the form of # to the FE, then our home grown code formats the digits in that format. Example, for United states, I am supplying USD###,###,###.####. Here, I need to let the front end know the below information so that front end formats the same in a prompt manner. My question is: Is there any way to get the below information in the backend:
- Where to place the currency, start of the number or towards ending?
- Is there any space between number and symbol? Look at USD976,543.21 and 976 543,21 € . There is space between currency symbol and number for EURO but not for USD.
I am using java.util.Currency.
All my formatting is happening in the front end and not the backend.
caught my eye. hence gave him an easy well-evolved solution. :) – Concoct