how to format decimal into Indian currency format? i.e. 1234567.89 to 12,34,567.89
0
Is there any function we can use to convert a decimal into Indian currency format? I have tried formatDecimal() . With formatDecimal() I am able to convert into American format only (1234567.89 to 1,234,567.89) but what I want to achieve is to convert 1234567.89 to 12,34,567.89. In other words, while moving towards left from decimal point, after 3 digit I need to put a comma and then after every two digit a comma.
asked
Prathamesh Manjrekar
2 answers
1
Hi Prathemesh,
You can format the decimal like below:
formatDecimal(1234567.89,'##,##,###.##') – This will give you result in string.
After that use parseDecimal to convert string to decimal.
answered
Steffy D
0
Have a look at the Decimal Tools module in the marketplace. It provides a more fully featured version of the built-in formatDecimal function that can convert a decimal to a string that isn’t dependant on the current locale.