Subject | Re: [firebird-support] Re: NUMERIC(18,6) calculation problem |
---|---|
Author | Alexandre Benson Smith |
Post date | 2006-02-23T23:44:35Z |
Luis Madaleno wrote:
Don't know how it would mess with your precision but this could solve
your overflow problem:
declare variable tmp1 double precision;
declare variable tmp2 double precision;
begin
tmp1 = new.fld1;
tmp2 = new.fld2;
new.fld3 = CAST((tmp1 * tmp2) AS NUMERIC(18,6));
end;
see you !
--
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br
> Hi,Hi,
>
> No. I mean I tried with both:
>
> declare variable tmp NUMERIC(18,12);
> declare variable tmp1 NUMERIC(18,6);
> declare variable tmp2 NUMERIC(18,6);
> begin
> tmp1 = new.fld1;
> tmp2 = new.fld2;
> tmp = tmp1 * tmp2;
> end;
>
> and
>
> declare variable tmp NUMERIC(18,12);
> declare variable tmp1 NUMERIC(18,6);
> declare variable tmp2 NUMERIC(18,6);
> begin
> tmp1 = new.fld1;
> tmp2 = new.fld2;
> new.fld3 = CAST((tmp1 * tmp2) AS NUMERIC(18,6));
> end;
>
> But both fail.
>
>
Don't know how it would mess with your precision but this could solve
your overflow problem:
declare variable tmp1 double precision;
declare variable tmp2 double precision;
begin
tmp1 = new.fld1;
tmp2 = new.fld2;
new.fld3 = CAST((tmp1 * tmp2) AS NUMERIC(18,6));
end;
see you !
--
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br