mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-25 09:18:51 +01:00
Shorten shortenNumber code
This commit is contained in:
parent
5fa02f9cc4
commit
4bf6b00b94
1 changed files with 4 additions and 6 deletions
|
@ -1,7 +1,5 @@
|
||||||
const { locale } = Intl.NumberFormat().resolvedOptions();
|
const { locale } = Intl.NumberFormat().resolvedOptions();
|
||||||
|
const shortenNumber = Intl.NumberFormat(locale, {
|
||||||
export default function shortenNumber(num) {
|
|
||||||
return Intl.NumberFormat(locale, {
|
|
||||||
notation: 'compact',
|
notation: 'compact',
|
||||||
}).format(num);
|
}).format;
|
||||||
}
|
export default shortenNumber;
|
||||||
|
|
Loading…
Reference in a new issue