Languages
Supported languages and how to change the language to use.
Supported languages
The supported languages and cultures a registered following the Microsoft's Culture Names.
Culture | Code |
---|
Define a new language
You can easily define your own language if you can find what yuo want in the list of supported languages.
// load a language
numbro.language('fr-BE', {
delimiters: {
thousands: ' ',
decimal: ','
},
abbreviations: {
thousand: 'k',
million: 'm',
billion: 'b',
trillion: 't'
},
ordinal : function (number) {
return number === 1 ? 'er' : 'ème';
},
currency: {
symbol: '€',
position: 'postfix'
},
defaults: {
currencyFormat: ',0000 a'
},
formats: {
fourDigits: '0000 a',
fullWithTwoDecimals: ',0.00 $',
fullWithTwoDecimalsNoCurrency: ',0.00',
fullWithNoDecimals: ',0 $'
}
});
Change language
To change the language to use, you only need to use the language
function with the culture code of the language needed.
// switch between languages
numeral.language('fr-BE');