From d566a2663197d7c59de8a06f08c53d793712c218 Mon Sep 17 00:00:00 2001 From: Mary Date: Wed, 2 Oct 2024 14:44:45 +0700 Subject: [PATCH] blergh --- src/view/com/util/numeric/format.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/view/com/util/numeric/format.ts b/src/view/com/util/numeric/format.ts index 6841259f9b..0063d274a6 100644 --- a/src/view/com/util/numeric/format.ts +++ b/src/view/com/util/numeric/format.ts @@ -2,9 +2,7 @@ import type {I18n} from '@lingui/core' import {isWeb} from '#/platform/detection' -// `@formatjs/intl-numberformat/polyfill` doesn't support `roundingMode`, and -// we'd ideally want `roundingMode: trunc` to properly display shortened counts -// without it being rounded up, which can be misleading for follower count. +// `@formatjs/intl-numberformat/polyfill` doesn't support `roundingMode` const truncateRounding = (num: number): number => { if (num < 1_000) { return num @@ -21,6 +19,8 @@ export const formatCount = (i18n: I18n, num: number) => { notation: 'compact', maximumFractionDigits: 1, // `1,953` shouldn't be rounded up to 2k, it should be truncated. + // @ts-expect-error: `roundingMode` doesn't seem to be in the typings yet + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#roundingmode roundingMode: 'trunc', }) }