Subject | Re: [firebird-support] NUMERIC(18,6) calculation problem |
---|---|
Author | Luis Madaleno |
Post date | 2006-02-23T22:57:21Z |
Hi,
This seems not to work either:
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;
new.fld3 = CAST((tmp1 * tmp2) AS NUMERIC(18,6));
end;
Radu Sky wrote:
This seems not to work either:
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;
new.fld3 = CAST((tmp1 * tmp2) AS NUMERIC(18,6));
end;
Radu Sky wrote:
> Luis Madaleno wrote:
>
>> But I am always multiplying by 1.
>> Since fld2 is always 1 (in my tests):
>>
>> new.fld3 = new.fld1 * 1;
>> this shouldn't return any error;
>>
>> But should NUMERIC(18,6) allow for bigger values?
>>
>> Luis
>>
>>
>
> Hello,
>
> No matter that you multiply by 1, fld2 is declared as NUMERIC(18,6) so
> the result is will be NUMERIC(18,12);
> Use CAST as NUMERIC(18,6)
>
> HTH
> Radu
>
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://firebird.sourceforge.net and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>