Skip to content

@swapped/connect-sdk / format / formatCurrencyAmount

Function: formatCurrencyAmount()

formatCurrencyAmount(number, options?): string

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

Formats a currency-style value with smarter handling for very small amounts. Defaults to 2 decimal places; with firstNonZeroDecimal, expands precision so the first significant digit after the decimal is visible (e.g. 0.0001).

Parameters

number

string | number

Value to format (number or numeric string)

options?

FormatCurrencyAmountOptions = {}

Optional formatting flags

Returns

string

Formatted currency-style string