Skip to content

formatInteger

Formats a number as an integer with thousand separators.

ts
import { formatInteger } from '@swapped/connect-sdk/format'

formatInteger(0)
// "0"

formatInteger(1234)
// "1,234"

formatInteger(1_000_000)
// "1,000,000"

formatInteger(12.9)
// "13"             — rounds to nearest integer

formatInteger(-1234)
// "-1,234"