Subject | Re: About UDF's problem |
---|---|
Author | Adam |
Post date | 2005-08-15T01:42:39Z |
--- In firebird-support@yahoogroups.com, Yang Jin <ojinyang@y...> wrote:
SQL> select cast(13.275 as numeric(9,2)) from rdb$database;
CAST
============
13.28
SQL> select cast(13.228 as numeric(9,2)) from rdb$database;
CAST
============
13.23
Both of which look reasonable to me. Perhaps Value1 is not what you
think it is? It could reasonably be 13.2749999999, which would be
rounded correctly to 13.27, but it may round it to 13.275 when it
displays it in 3dp.
Adam
> Thanks.I am getting a slightly different result in iSQL
> But a new problem found.
> Cast (Value1 as numeric(9,2)),Value1= 13.275,reuslt is 13.27;
> Cast (Value2 as numeric(9,2)),Value2= 13.228,reuslt is 13.23;
> what is the rule to round?
>
SQL> select cast(13.275 as numeric(9,2)) from rdb$database;
CAST
============
13.28
SQL> select cast(13.228 as numeric(9,2)) from rdb$database;
CAST
============
13.23
Both of which look reasonable to me. Perhaps Value1 is not what you
think it is? It could reasonably be 13.2749999999, which would be
rounded correctly to 13.27, but it may round it to 13.275 when it
displays it in 3dp.
Adam