Subject RE: [firebird-support] Rounding numbers in a stored procedure
Author Paul Mercea
For me works these
select cast(cast(12.34 as double precision)/(cast(27 as double precision))
as numeric(8,2)) from rdb$database=>0.46
and
select cast(12.34/27 as numeric(8,2)) from rdb$database =>0.46

Regards
PaulM

-----Original Message-----
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of flipmooooo
Sent: Wednesday, April 12, 2006 8:36 PM
To: firebird-support@yahoogroups.com
Subject: [firebird-support] Rounding numbers in a stored procedure

Hi,

I'm doing some calculations in a stored procedure and i want to round
the calculated results on 2 decimals but not using the baker rounding
methode.
I think i'll have to write a new UDF fucntion, but i would prefer not
to. Is there any other function available to obtain the results below
shown in the example.

Example:
Round on 2 decimals: Round up if 3the decimal part greater or equal to
5.

12.34 / 25 = 0,4936 > 0,49
12.34 / 27 = 0,45703703703703703703703703703704 > 0,46

Greetings,
Filip Moons






++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

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