Subject Re: The integer part of a number
Author mauriciobornacin
Can anybody explain why
select cast(((24/60) + 0.495)as integer ) from table;
equals 0 and
select cast(((24/60) + 0.5)as integer ) from table;
equals 1

I'm trying to round on minutes and make a phone rate calculation


--- In firebird-support@yahoogroups.com, Milan Babuskov <milanb@...>
wrote:
>
> Alexandre Benson Smith wrote:
> > But when I was replying I saw he wants just the integer part
besides
> > rounding, then I will suggest an UDF.
>
> There are different kinds of rounding, most of them having
different way
> to handle 0.5 values. For some uses this is enough:
>
> select cast(x + 0.5 as integer) from rdb$database;
>
>
> --
> Milan Babuskov
> http://swoes.blogspot.com/
> http://www.flamerobin.org
>