Use Intl
or the number
prototype to format number to any specified currency.
|
|
- Javascript falls back on runtime locale if you specify an unavailable locale. This is used to format number
- You can see the complete list of currency codes here.
Or, use number
prototype-
|
|
If you are using a framework that does not provide direct currency support just include the above in a globally accessible script and use it everywhere. For example, you would define the format in global filters in Vue and use that filter wherever needed.