The DECIMALS setting is not applied correctly: the 0-padding is missing
DECIMALS isn't only about rounding but also refers specifically to the number of digits to be displayed after the decimal separator of the observation values in the table, such as in "3.14 is the approximation of π to two decimals" or in "10.00 is the correct writing of 10 with two decimals.
This eases the user's reading of the data table because this feature will vertically align the decimal separators.
Assuming that the value for the DECIMALS attribute is N. All observation values to which this attribute value is attached will be displayed with exactly N digits after the decimal separator:
- If an observation value has exactly N significant digits after the decimal separator, then it is displayed without transformation (with only the N digits after the decimal separator and no additional padding with zeros).
- If an observation value has more than N significant digits after the decimal separator, then it is rounded at exactly N digits after the decimal separator (without suppressing any ending zeros and without additional padding with zeros).
- If an observation value has less than N significant digits after the decimal separator, then it is padded at its end with as many zeros as needed in order to obtain exactly N digits after the decimal separator.
Some examples:
Original value | DECIMALS=2 | DECIMALS=1 | DECIMALS=0 |
---|---|---|---|
68.854309 | 68.85 | 68.9 | 69 |
68.859609 | 68.86 | 68.9 | 69 |
68.895609 | 68.90 | 68.9 | 69 |
72.95411 | 72.95 | 73.0 | 73 |
72.95511 | 72.96 | 73.0 | 73 |
7.9936891 | 7.99 | 8.0 | 8 |
7.9966891 | 8.00 | 8.0 | 8 |
8.102003 | 8.10 | 8.1 | 8 |
5 | 5.00 | 5.0 | 5 |
This functional requirement applies to both Data Explorer and Viewer applications.
Practical example:
Edited by Jens Dossé