mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-12-18 21:32:01 +03:00
12 lines
223 B
JavaScript
12 lines
223 B
JavaScript
import { i18n } from '@lingui/core';
|
|
|
|
export default function shortenNumber(num) {
|
|
try {
|
|
return i18n.number(num, {
|
|
notation: 'compact',
|
|
roundingMode: 'floor',
|
|
});
|
|
} catch (e) {
|
|
return num;
|
|
}
|
|
}
|