Infragistics ultraCurrencyEditor adds nonsignificant zero to decimal value after editing
When modifying Infragistics ultraCurrency editor values, after editing the decimal value is modified such that equality matches no longer work. Editing the value can add a nonsignificant zero to the ultraCurrency value, which causes equality checks to return FALSE even when the decimal value hasn't changed.
Initially nonsignificant trailing zeros in the fractional part of the value after the decimal point, are not displayed by the MESSAGE statement. This is expected. But after editing, a zero is added which causes the equality match to fail. For example with the following button trigger code the button checks the initial values of the ultraCurrencyEditors by adding them and calculating the difference:
DEFINE VARIABLE d1 AS DECIMAL FORMAT "$->>>>>>>9.99" NO-UNDO.
DEFINE VARIABLE d2 AS DECIMAL FORMAT "$->>>>>>>9.99" NO-UNDO.
d1 = ultraCurrencyEditor1:value + ultraCurrencyEditor2:value + ultraCurrencyEditor3:value.
d2 = ultraCurrencyEditor4:value.
MESSAGE "814.98 + 325.79 + 79.13 = " d2 "?" d1 = d2 SKIP(2)
"814.98 + 325.79 + 79.13 = " d1 SKIP
"Total value = " d2 SKIP(1)
"(814.98 + 325.79 + 79.13) - " d2 " = " d1 - d2
If the total value is edited and re-entered as the same value (1219.90), then the button used again to check the values, this results in:
For some reason the nonsignificant trailing zero is no longer truncated by the MESSAGE statement, and this causes the equality match to fail.