Subject Re: Numeric rounding?
Author sgharp
--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@t...>
wrote:
> At 06:43 PM 4/01/2005 +0000, you wrote:
>
>
> >Hi All,
> >
> >I have a table (FB 1.5) with a field defined as Numeric(12,4). I use
> >this field in a store procedure with a variable defined as
> >Numeric(12,2). When the field is selected into the variable it stores
> >something like 123.4567 in the defined variable instead of rounding it
> >to 123.46 as expected. Is there a way to make Firebird respect the
> >variable definition in the stored procedure and round the number
> >correctly?
>
> Cast the incoming (12,4) as (12,2). E.g.
>
> ...
> declare newvar numeric(12,2);
> .....
>
> for select (
> ....,
> cast(original as numeric(12,2)),
> ....
> into
> .....
> :newvar,

Am I correct in thinking that this is a bug in Firebird? It would
seem that when a variable is defined of a certain size, it would
either respect the definition or throw and exception.