views:

25

answers:

0

I have noticed that when we use F_RoundToEven UDF from FreeAdhocUDF, that it fails to produce a correct result with certain numbers.

For example, the query:

select
  F_RoundToEven(21.145, 2) Correct,
  F_RoundToEven(215.145, 2) Fail
from Rdb$Database

produces the result:

CORRECT FAIL
21.14   215.15

Obviously these two number should both resolve to .14

Has anyone else come across this problem, and perhaps found a way around it?

I am using the latest version of FreeAdhocUDF with Firebird 2.1 and it fails on both Windows 32bit and Linux 64bit.

Thanks.