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 |
|
NUMBER FORMAT |
|
DECIMAL PLACES FOR PRECISION |
|
STRIP TRAILING ZEROS FOR PRECISION |
|
ATL in Script | Result | Notes |
---|---|---|
| 1,762.12 | The optional parameters are unspecified, so the project settings apply. |
| 1,762 | The input number is displayed to zero decimal places. |
| 1,762.125 | The input number is displayed to three decimal places. |
| 1,760 | The input number is displayed as an integer rounded one place to the left of the decimal point. |
| 1,800 | The input number is displayed as an integer rounded two places to the left of the decimal point. |
| 1,762 | The input number is displayed to two decimal places (1,760.00) but with the trailing zeros stripped. |
| 1,762.00 | The input number is displayed to two decimal places and with the trailing zeros retained. |