Subject | Re: The integer part of a number |
---|---|
Author | Adam |
Post date | 2006-11-24T05:08:02Z |
>Hmm, I need to check my sources then, it is possible I am confused
> I will answer that the cast to integer should do what he was after.
>
> But when I was replying I saw he wants just the integer part besides
> rounding, then I will suggest an UDF.
>
> When I saw your answer I tried again (as you said it will be SQL
> Standard behaviour)
>
> But if you are right then FB is not standard complaint in this aspect.
with something else.
I now suggest the OP rather looks at IB_UDF.SQL in their /UDF folder,
and registers the floor function. If it works as advertised, it will
be all they need.
DECLARE EXTERNAL FUNCTION floor
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_floor' MODULE_NAME 'ib_udf';
Select cast(floor(1.9) as integer) from rdb$database;
CAST
============
1
Adam