From f505c7f5fd62629d3e0219ad8415f5d90b523c5d Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Tue, 14 May 2024 16:12:31 -0400 Subject: [PATCH] Fix issues with formatLargeNumber --- src/utils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils.ts b/src/utils.ts index 90dfe0a21f9..142de91c1ca 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -192,7 +192,9 @@ export function formatLargeNumber(count: integer, threshold: integer): string { return '?'; } const digits = ((ret.length + 2) % 3) + 1; - const decimalNumber = parseInt(ret.slice(digits, digits + (3 - digits))); + let decimalNumber = ret.slice(digits, digits + 2); + while (decimalNumber.endsWith('0')) + decimalNumber = decimalNumber.slice(0, -1); return `${ret.slice(0, digits)}${decimalNumber ? `.${decimalNumber}` : ''}${suffix}`; }