Skip to content

Commit b491df9

Browse files
committed
perf: remove Intl
1 parent 82a423c commit b491df9

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/utils/format.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
export function formatBytes(bytes: number): string | undefined {
22
if (bytes === Infinity) return undefined
3-
const numberFormatter = new Intl.NumberFormat('en', {
4-
maximumFractionDigits: 2,
5-
minimumFractionDigits: 2,
6-
})
7-
8-
return `${numberFormatter.format(bytes / 1000)} kB`
3+
return `${(bytes / 1000).toFixed(2)} kB`
94
}

0 commit comments

Comments
 (0)