I am trying to format the amount I get from my API into the locale-specific format.
In console:
Intl.NumberFormat('en-IN').format(450000) // "4,50,000"
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 I can get ₹4,50,000.00
without specifying the delimiters explicitly (and be able to change the locale string 'en-IN'
to 'en-US'
to update).