Shorten shortenNumber code

This commit is contained in:
Lim Chee Aun 2023-07-23 14:09:39 +08:00
parent 5fa02f9cc4
commit 4bf6b00b94

View file

@ -1,7 +1,5 @@
const { locale } = Intl.NumberFormat().resolvedOptions();
export default function shortenNumber(num) {
return Intl.NumberFormat(locale, {
notation: 'compact',
}).format(num);
}
const shortenNumber = Intl.NumberFormat(locale, {
notation: 'compact',
}).format;
export default shortenNumber;