Skip to content

@swapped/connect-sdk / format / FormatCurrencyAmountOptions

Type Alias: FormatCurrencyAmountOptions

FormatCurrencyAmountOptions = object

Defined in: src/format/formatCurrencyAmount.ts:5

Properties

decimals?

optional decimals?: number

Defined in: src/format/formatCurrencyAmount.ts:17

Decimal places. Defaults to fiatDecimals (2 when unset). Per-call value wins over getFormatDefaults.


firstNonZeroDecimal?

optional firstNonZeroDecimal?: boolean

Defined in: src/format/formatCurrencyAmount.ts:12

Expand past the currency decimal floor (default 2) until the first non-zero digit is visible (e.g. 0.0001 instead of 0.00).


format?

optional format?: "js-number" | "pretty"

Defined in: src/format/formatCurrencyAmount.ts:23

Output style:

  • 'pretty' (default) — thousand separators
  • 'js-number' — no separators

removeTrailingZeros?

optional removeTrailingZeros?: boolean

Defined in: src/format/formatCurrencyAmount.ts:7

Strip trailing zeros after the decimal (e.g. 1.501.5).