2

There seems to be a different in rounding in OPA10 versus OPA12.

The number 27,775 gives an amount of 27,77 in OPA12 whereas OPA10 gives a result of 27,78.

Another variable wih value gives 83,325 rounds to 83,33 in both OPA10 and OPA12. This seems to be correct to me, the first example liiks inconsistent.

All variables are of type currency. Is there anyone who experiences the same problem and found a solution or explanation?

Zoyd
  • 3,449
  • 1
  • 18
  • 27
Anja
  • 29
  • 3
  • Seems like explicit rounding does the trick. – Anja Apr 18 '17 at 11:30
  • Both the results for OPA12 are consistent with the values being stored in the widespread IEEE 754 binary64 floating-point format (which can't represent most non-integral decimal values exactly), and correct rounding being used everywhere. Under that assumption, `27.775` would round down because the actual value stored is `27.77499999999999857891452847979962825775146484375`. Do you have a pointer to the definition of the currency type? – Mark Dickinson Apr 18 '17 at 17:08
  • I have no clue as to how the currency type is actually defined. New to Oracle Policy Automation :-) A way around it seems to make use of the function ROUND (or Afronden in Dutch) with a significant number of decimals = 2. Now I am figuring out at what point in the calculation to use the rounding. I think rounding the final result is the best way. – Anja Apr 21 '17 at 08:35

0 Answers0