Subject Re: [firebird-support] Re: Numeric rounding?
Author Ivan Prenosil
> > > I have a table (FB 1.5) with a field defined as Numeric(12,4). I use

CREATE TABLE tab (A NUMERIC(12,4));
INSERT INTO tab VALUES (123.4567);

> > > this field in a store procedure with a variable defined as
> > > Numeric(12,2).


CREATE PROCEDURE proc RETURNS (x1 NUMERIC(12,4), x2 VARCHAR(20)) AS
DECLARE VARIABLE var NUMERIC(12,2);

> When the field is selected into the variable

BEGIN
SELECT a FROM tab INTO :var;
x1 = :var;
x2 = :var;
END

> it stores
> > > something like 123.4567 in the defined variable instead of rounding it
> > > to 123.46 as expected.

EXECUTE PROCEDURE proc;

X1 X2
========== ============
123.4600 123.46


What are you doing differently ?
Ivan