Base Template

This commit is contained in:
2022-06-15 15:15:49 +07:00
parent 077e678979
commit f18bb85b94
47 changed files with 2597 additions and 1172 deletions

View File

@@ -1,9 +1,31 @@
import numeral from 'numeral';
// ----------------------------------------------------------------------
// load a locale
numeral.register('locale', 'id', {
delimiters: {
thousands: '.',
decimal: ','
},
abbreviations: {
thousand: 'k',
million: 'm',
billion: 'b',
trillion: 't'
},
ordinal : function (number: number) {
return number === 1 ? 'er' : 'ème';
},
currency: {
symbol: 'Rp '
}
});
// switch between locales
numeral.locale('id');
export function fCurrency(number: string | number) {
return numeral(number).format(Number.isInteger(number) ? '$0,0' : '$0,0.00');
return numeral(number).format('$0,0');
}
export function fPercent(number: number) {