Split workspace into electron and ui packages
This commit is contained in:
9
packages/ui/src/lib/formatters.ts
Normal file
9
packages/ui/src/lib/formatters.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export function formatTokenTotal(value: number): string {
|
||||
if (value >= 1_000_000) {
|
||||
return `${(value / 1_000_000).toFixed(1)}M`
|
||||
}
|
||||
if (value >= 1_000) {
|
||||
return `${(value / 1_000).toFixed(0)}K`
|
||||
}
|
||||
return value.toLocaleString()
|
||||
}
|
||||
Reference in New Issue
Block a user