Phase 3: Split utils.ts by responsibility
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 2m49s
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 2m49s
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
// ─── Number Formatting Functions ────────────────────────────────────────────────
|
||||
// ─── Formatting Functions ─────────────────────────────────────────────────────
|
||||
|
||||
/**
|
||||
* Format a number with K, M, B suffixes for large numbers
|
||||
*/
|
||||
export function fmt(n: number): string {
|
||||
if (!isFinite(n) || isNaN(n)) return '0';
|
||||
if (n >= 1e9) return (n / 1e9).toFixed(2) + 'B';
|
||||
@@ -11,9 +8,6 @@ export function fmt(n: number): string {
|
||||
return Math.floor(n).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Format a number with a fixed number of decimal places
|
||||
*/
|
||||
export function fmtDec(n: number, d: number = 1): string {
|
||||
return isFinite(n) ? n.toFixed(d) : '0';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user