function compact(value: NumberType, options: RoundingConfigType = {}): string
Formats a number into a short, human-readable string with a suffix (e.g., K, M, B).
Params
- value (NumberType): The value to be compacted. Can be a number, string, or bigint.
- options (RoundingConfigType): Configuration for rounding the compacted value.
Returns
(string): The compacted number with a suffix as a string.
Example
value
mode
precision