2024-08-13 10:26:23 +03:00
|
|
|
import { i18n } from '@lingui/core';
|
|
|
|
|
|
|
|
export default function shortenNumber(num) {
|
2024-08-20 14:58:50 +03:00
|
|
|
try {
|
|
|
|
return i18n.number(num, {
|
|
|
|
notation: 'compact',
|
|
|
|
roundingMode: 'floor',
|
|
|
|
});
|
|
|
|
} catch (e) {
|
|
|
|
return num;
|
|
|
|
}
|
2024-08-13 10:26:23 +03:00
|
|
|
}
|