Merge pull request #4402 from sarmah-rup/fix/format-long-number-billions

fix: formatLongNumber shows billions ~1000x too large on metric tiles
This commit is contained in:
Mike Cao authored and GitHub committed 2026-07-23 14:21:08 -07:00
commit 33ac648d1f
2 files changed
+3 -1

No files matched your search

+2
View File
@@ -27,6 +27,8 @@ test('formatNumber', () => {
});
test('formatLongNumber', () => {
expect(format.formatLongNumber(1000000000)).toBe('1.0b');
expect(format.formatLongNumber(2500000000)).toBe('2.5b');
expect(format.formatLongNumber(1200000)).toBe('1.2m');
expect(format.formatLongNumber(575000)).toBe('575k');
expect(format.formatLongNumber(10500)).toBe('10.5k');
+1 -1
View File
@@ -51,7 +51,7 @@ export function formatLongNumber(value: number) {
const n = Number(value);
if (n >= 1000000000) {
return `${(n / 1000000).toFixed(1)}b`;
return `${(n / 1000000000).toFixed(1)}b`;
}
if (n >= 1000000) {
return `${(n / 1000000).toFixed(1)}m`;