I'm working on converting the amount retrieved from my API into a format specific to the user's locale.
When using the console:
Intl.NumberFormat('en-IN').format(450000) // "4,50,000"
But in an Angular 2 component template:
{{ Intl.NumberFormat('en-IN').format(450000) }} // Cannot read property 'NumberFormat' of undefined
{{ 450000 | currency:'INR':true }} // ₹450,000.00
Is there a way to achieve ₹4,50,000.00
without explicitly setting delimiters (and have the ability to switch from 'en-IN'
to 'en-US'
for locale changes)?