@welldot/utils
FormatNumberOptions
Properties
fallback?
optionalfallback?:string
Returned for null, undefined, or NaN inputs. Defaults to '—'.
fractionDigits?
optionalfractionDigits?:number
Fixed decimal precision — sets both min and max. Takes precedence over the pair below.
locale?
optionallocale?:string
BCP 47 locale string (e.g. 'en-US', 'pt-BR', or bare 'en'/'pt'). Defaults to 'en-US'.
maximumFractionDigits?
optionalmaximumFractionDigits?:number
Maximum fraction digits (ignored if fractionDigits is set).
minimumFractionDigits?
optionalminimumFractionDigits?:number
Minimum fraction digits (ignored if fractionDigits is set).
suffix?
optionalsuffix?:string
String appended after the number, separated by a space (e.g. 'm', 'ft', 'm³').