numbro
Version:
Format and manipulate numbers.
59 lines (57 loc) • 1.4 kB
JavaScript
/*!
* numbro.js language configuration
* language : Spanish
* locale: Colombia
* author : Gwyn Judd : https://github.com/gwynjudd
*/
module.exports = {
languageTag: "es-CO",
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: "€",
position: "postfix",
code: "EUR"
},
currencyFormat: {
thousandSeparated: true,
totalLength: 4,
spaceSeparated: 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
}
}
};