NumFormatExtensions extension
Format numbers: significant digits, compact (1.2K).
- on
Methods
-
roundToSignificantDigits(
int significantDigits) → double -
Available on num, provided by the NumFormatExtensions extension
Rounds tosignificantDigitssignificant digits. -
toCompactString(
{int decimals = 1}) → String -
Available on num, provided by the NumFormatExtensions extension
Formats as compact string (e.g. 1200 → "1.2K", 1500000 → "1.5M").