numbro
Version:
Format and manipulate numbers.
60 lines (58 loc) • 1.44 kB
JavaScript
/*!
* numbro.js language configuration
* language : Spanish
* locale: Nicaragua
* author : Gwyn Judd : https://github.com/gwynjudd
*/
module.exports = {
languageTag: "es-NI",
delimiters: {
thousands: ",",
decimal: "."
},
abbreviations: {
thousand: "k",
million: "mm",
billion: "b",
trillion: "t"
},
ordinal: (number) => {
let b = number % 10;
return (b === 1 || b === 3) ? "er" : (b === 2) ? "do" : (b === 7 || b === 0) ? "mo" : (b === 8) ? "vo" : (b === 9) ? "no" : "to";
},
currency: {
symbol: "C$",
position: "prefix",
code: "NIO"
},
currencyFormat: {
thousandSeparated: true,
totalLength: 4,
spaceSeparated: true,
spaceSeparatedCurrency: true,
average: true
},
formats: {
fourDigits: {
totalLength: 4,
spaceSeparated: true,
average: true
},
fullWithTwoDecimals: {
output: "currency",
mantissa: 2,
spaceSeparated: true,
thousandSeparated: true
},
fullWithTwoDecimalsNoCurrency: {
mantissa: 2,
thousandSeparated: true
},
fullWithNoDecimals: {
output: "currency",
spaceSeparated: true,
thousandSeparated: true,
mantissa: 0
}
}
};