FormatUnitsOptions
FormatUnitsOptions =
object
Defined in: packages/synapse-core/src/utils/format.ts:32
Properties
Section titled “Properties”compact?
Section titled “compact?”
optionalcompact?:boolean
Defined in: packages/synapse-core/src/utils/format.ts:45
Compact formatting (e.g. “1,000” becomes “1K”).
decimals?
Section titled “decimals?”
optionaldecimals?:number
Defined in: packages/synapse-core/src/utils/format.ts:37
The number of decimals. If not provided, the default is 18.
decimalsRounding?
Section titled “decimalsRounding?”
optionaldecimalsRounding?:"ROUND_HALF"|"ROUND_UP"|"ROUND_DOWN"
Defined in: packages/synapse-core/src/utils/format.ts:60
Method used to round to digits decimals (defaults to “ROUND_HALF”).
digits?
Section titled “digits?”
optionaldigits?:number
Defined in: packages/synapse-core/src/utils/format.ts:41
The number of digits to display after the decimal point.
locale?
Section titled “locale?”
optionallocale?:Intl.LocalesArgument
Defined in: packages/synapse-core/src/utils/format.ts:55
The locale to use for formatting.
signDisplay?
Section titled “signDisplay?”
optionalsignDisplay?:"auto"|"always"|"exceptZero"|"negative"|"never"
Defined in: packages/synapse-core/src/utils/format.ts:66
How to display the sign of the number (defaults to “auto”).
trailingZeros?
Section titled “trailingZeros?”
optionaltrailingZeros?:boolean
Defined in: packages/synapse-core/src/utils/format.ts:49
Add trailing zeros if any, following the number of digits.