Double property fields rounded incorrectly
SummaryText input field for property of type Double is configured with read-only formatting of type Number with two decimal places. On entering a long value (for example, 123456789123456789.123456789), the focus leaves the field and the value displayed is rounded incorrectly (for example, 123,456,789,123,456,784.00).For example, Enter 123456789123456789.123456789 (a long value).The value displayed is rounded incorrectly as, 123,456,789,123,456,784.00.
Error MessagesNot Applicable
Steps to Reproduce
- Configure a text input field for a Double property with read-only formatting of type Number with two decimal places.
- Enter a long value (for example, a value of 20 digits).
- Tab out of the field such that read-only formatting is displayed.
Root CauseAn issue in the custom application code or rules.Double data type in Java has a known limitation of 15 to 16 decimal points precision. Since this is the underlying data type for Double properties, it cannot manage large numbers.
ResolutionPerform the following local-change:Change the properties to Decimal data types. They use Java BigDecimals internally which are designed to handle arbitrary size numbers and are recommended for use in applications where large numbers are encountered.
Published June 26, 2019 — Updated August 19, 2019