I am working on an application using React Native where I need to show currency in Euro and in rupees as well.
I am using Javascript's Intl for formatting the currency as per the locale using en-IN
for rupees and en-GB
for euro.
but the currency is shown with different formatting on iOS and in android, in iOS the currency is showing correctly for IN like 3,74,73,474
but the same is shown on android with this format: 37,473,474
. Not sure how do I approach for this. Below is the utility function I wrote for formatting:
getformattedCurrency(value) {
const formatter = new Intl.NumberFormat('en-IN', {
style: 'currency',
currency: 'INR'
minimumFractionDigits: 0,
maximumFractionDigits: 0,
});
return formatter.format(value);
}
I know that android's native have DecimalFormat to do this but I want to achieve this via JS only.
Any help is appreciated ! Thanks.
37473474
not37473.474