MCPcopy Create free account
hub / github.com/firebase/firebase-tools / formatNumber

Function formatNumber

src/profileReport.ts:45–52  ·  view source on GitHub ↗
(num: number)

Source from the content-addressed store, hash-verified

43}
44
45export function formatNumber(num: number) {
46 const parts = num.toFixed(2).split(".");
47 parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
48 if (+parts[1] === 0) {
49 return parts[0];
50 }
51 return parts.join(".");
52}
53
54export function formatBytes(bytes: number) {
55 const threshold = 1000;

Callers 6

formatBytesFunction · 0.85
renderUnindexedDataMethod · 0.85
renderBandwidthMethod · 0.85
renderOperationSpeedMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…