Skip to content

@swapped/connect-sdk / format / formatFloat

Function: formatFloat()

formatFloat(number): string

Defined in: src/format/formatFloat.ts:13

Formats a number with thousand separators on the integer part while preserving the original decimal digits (no rounding or padding).

Scientific notation is expanded (1e-70.0000001). NaN and Infinity return ''.

Parameters

number

number

The number to format

Returns

string

Pretty integer part plus original fractional digits when present, or '' when invalid