Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Intl.NumberFormat alter currency symbol

I’ve read through the Intl.NumberFormat docs and can’t find a simple way to achieve something.
I want to use a custom character for the minus symbol:

instead of -

(UNICODE − instead of ASCII Code -)

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

for screen reader reasons.

I don’t see an option to do this in the Intl.NumberFormat – is there a way to change the character for currency formatting as part of the options?

Or is simply tagging a replace onto the end the best approach?

>Solution :

To put it very plainly, there is not a way to change the - to an within the Intl.NumberFormat. Just tag on a .replace('-', '−') at the end of the Intl.NumberFormat and you’ll be good.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading