MCPcopy
hub / github.com/redpanda-data/console / prettyNumber

Function prettyNumber

frontend/src/utils/utils.ts:604–615  ·  view source on GitHub ↗
(num: number)

Source from the content-addressed store, hash-verified

602const toG = (num: number) => `${(num / ONE_BILLION).toFixed(1)}g`;
603
604export function prettyNumber(num: number) {
605 if (Number.isNaN(num) || isInfinite(num) || num < ONE_THOUSAND) {
606 return String(num);
607 }
608 if (isK(num)) {
609 return toK(num);
610 }
611 if (isM(num)) {
612 return toM(num);
613 }
614 return toG(num);
615}
616
617export function fromDecimalSeparated(str: string): number {
618 if (!str || str === '') {

Callers 3

formatMarksFunction · 0.90
tipTextFunction · 0.90
formatRateFunction · 0.90

Calls 5

isInfiniteFunction · 0.85
toKFunction · 0.85
toMFunction · 0.85
toGFunction · 0.85
StringInterface · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…