BenjaminVanRyseghem / numbro

A JS library for number formatting
http://numbrojs.com
MIT License
1.1k stars 198 forks source link

How to override the default currency format for en-US? #727

Open christian-ritter opened 1 year ago

christian-ritter commented 1 year ago

How can I override the default currency format for language en-US?

For other languages I do it as follows:

const en = require('numbro/dist/languages/en-GB.min') as numbro.NumbroLanguage;

en.currencyFormat.average = false;
en.currencyFormat.spaceSeparated = true;
en.currencyFormat.thousandSeparated = true;
en.currencyFormat.mantissa = 2;
en.currencyFormat.totalLength = 0;
en.currencyFormat.currencySymbol = '€';

numbro.registerLanguage(en);

But for en-US there is no language file available that I could import and override. Of course I could set the format where ever I use .formatCurrency() but I want it to be configured on a central place.