Skip to main content

Function: formatCompactNumber()

formatCompactNumber(value): string

Defined in: ui/GeoVisLegend.formatters.ts:41

Public, reusable compact-number formatter (e.g. 1500 → "1.5k", 2_000_000 → "2M"). It is the exported, stable name for the same abbreviation behaviour as abbreviateNumber; consumers should prefer this alias. Exposed so application code (and stories) can format compact values without re-implementing the rule.

NOTE: GeoVisLegend uses this formatter by default for proportional-circle legends (see resolveFormatter in GeoVisLegend.utils.tsx) unless an explicit formatValue prop is provided, which always takes precedence.

Parameters

ParameterType
valuenumber

Returns

string