githubEdit

Number

To format numbers, use the $number format function:

Variable Name: the name of your variable that will contain the value to be formatted. Format String: the text code that tells Documint how to would like to format the value

General

$number

Used for applying custom formatting to numbers.

Signature

{{$number value format_string [locale]}}

Arguments

Name
Description
Type
Required

value

Name of variable to be formatted

Number

format_string

Pattern for formatting variable. See guide below

String

locale

Specify which locale to use for formatting currencies. See list below

String

default=

Default value to display when value is blank. Default=''

StringNumber

Returns

Formatted number

Example #1 - Basic

Example #2 - With Default

Standard

Value
Format String
Result

10000

"0,0.0000"

10,000.0000

10000.23

"0,0"

10,000

10000.23

"+0,0"

+10,000

-10000

"0,0.0"

-10,000.0

10000.1234

'0.000'

10000.123

100.1234

"00000"

00100

1000.1234

"000000,0"

001,000

10

"000.00"

010.00

10000.1234

"0[.]00000"

10000.12340

-10000

"(0,0.0000)"

(10,000.0000)

-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

-104000

"0a"

-104k

1

"0o"

1st

100

"0o"

100th

Currency

Example:

Number

Format String

String

1000.234

'$0,0.00'

$1,000.23

1000.2

'0,0[.]00 $'

1,000.20 $

1001

'$ 0,0[.]00'

$ 1,001

-1000.234

'($0,0)'

($1,000)

-1000.234

'$0.00'

-$1000.23

1230974

'($ 0.00 a)'

$ 1.23 m

Percentage

Number

Format String

String

1

'0%'

100%

0.974878234

'0.000%'

97.488%

-0.43

'0 %'

-43 %

0.43

'(0.000 %)'

43.000 %

Duration

Number

Format String

String

25

'00:00:00'

0:00:25

238

'00:00:00'

0:03:58

63846

'00:00:00'

17:44:06

Source: numeral.jsarrow-up-right

Last updated

Was this helpful?