Touch Up Dashboard

This commit is contained in:
2022-05-26 15:14:34 +07:00
parent 79c4a5c241
commit e8bb61be2f
19 changed files with 993 additions and 502 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) {