Skip to main content

precision

Defines the precision with which a number is displayed but does not change its actual value.

Parameters

  • VALUE (number)

    The number to format.

  • DECIMAL PLACES (number)

    Optional. The number of decimal places to display. When a negative value (X) is entered, the input number is displayed as an integer rounded X places to the left of the decimal point. This is demonstrated below.

    Default: 2

  • STRIP TRAILING ZEROS (Boolean)

    Optional. Whether to strip trailing zeros from the result (true) or leave them in place (false). 

    Default: true

Important

The default values above are the system defaults. You can change these defaults in your project's Settings view. See Settings > Number and Currency for guidance.

Examples

Assume the settings in Settings > Number and Currency are:

Setting

Value

LOCALE

en_US

NUMBER FORMAT

#,##0.##

DECIMAL PLACES FOR PRECISION

2

STRIP TRAILING ZEROS FOR PRECISION

true

ATL in Script

Result

Notes

[[precision(1762.12475)]]

1,762.12

The optional parameters are unspecified, so the project settings apply.

[[precision(1762.12475,0)]]

1,762

The input number is displayed to zero decimal places.

[[precision(1762.12475,3)]]

1,762.125

The input number is displayed to three decimal places.

[[precision(1762.12475,-1)]]

1,760

The input number is displayed as an integer rounded one place to the left of the decimal point.

[[precision(1762.12475,-2)]]

1,800

The input number is displayed as an integer rounded two places to the left of the decimal point.

[[precision(1762,2,true)]]

1,762

The input number is displayed to two decimal places (1,760.00) but with the trailing zeros stripped.

[[precision(1762,2,false)]]

1,762.00

The input number is displayed to two decimal places and with the trailing zeros retained.