Skip to content

thousandSeparator

Input a number num and return a string with thousand separators.

Added in v0.0.1

Usage

ts
import { thousandSeparator } from 'parsnip-kit'

thousandSeparator(100) // '100'
thousandSeparator(1000) // '1,000'
thousandSeparator(10000) // '10,000'
thousandSeparator(1234567) // '1,234,567'
thousandSeparator(-1234567) // '-1,234,567'
thousandSeparator(1234.567) // '1,234.567'
thousandSeparator(1234.5678) // '1,234.567,8'

API

Arguments

ArgTypeOptionalDefaultDescription
numnumberfalseundefinedThe number to format

Returns

Type
string