Number Formatting

Possible Input for The numeral.js Format String

Floating point



Number

Format String

Output

10000

'0,0.0000'

10.000,0000

10000.23

'0,0'

10

-10000

'0,0.0'

-10.000,0

-0.23

'.00'

-,23

-0.23

'(.00)'

(,23)

0.23

'0.00000'

0,23000

0.23

'0.0[0000]'

0,23

1230974

'0.0a'

1,2m

1460

'0 a'

1 k

1

'0o'

1st




Currency



Number

Format String

Output

1.000.234

'$0,0.00'

$1.000,23

1000.2

0,0[.]00 $'

1.000,20 $

1001

'$ 0,0[.]00'

$ 1.001




Percentage



Number

Format String

Output

1

'0%'

100%

-0.43

'0 %'

-43%

Source