Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

round - function

45 views
Skip to first unread message

Wim De Coorde

unread,
May 4, 2002, 9:20:00 AM5/4/02
to
Hi


I know there a function round in oracle and format in mysql to round
decimals

But i can't find a function in Interbase6.0 to do this work....

i included the udf library, but there does't seem to be a function that
could help me


someone here could help me please?


Friendly regards

Wim


Sergio Samayoa

unread,
May 4, 2002, 3:54:04 PM5/4/02
to
CAST the number you want to round. Example:

select cast(4.45 as numeric(4,1)) from rdb$database

This returns 4.5

--
Sergio Samayoa
Lógica Software
http://www.geocities.com/logicasw/

Wim De Coorde

unread,
May 4, 2002, 9:31:35 PM5/4/02
to
"Sergio Samayoa" <ser...@terra.com.gt> schreef in bericht
news:3cd43b22_1@dnews...

> CAST the number you want to round. Example:
>
> select cast(4.45 as numeric(4,1)) from rdb$database
>
> This returns 4.5


thanks, but I don't have to convert it into another datatype

the datatype of the column is already "double precision", but the contens is
50.099999999 and it has tot become 50.10


Greetz

Wim


Achim Kaiser

unread,
May 5, 2002, 12:17:33 PM5/5/02
to
Wim,

Here is a link you should read :

http://community.borland.com/article/0,1410,25210,00.html

HTH

Achim
"Wim De Coorde" <wi...@pandora.be> schrieb im Newsbeitrag
news:3cd48b76$1_2@dnews...

Sergio Samayoa

unread,
May 6, 2002, 7:23:19 PM5/6/02
to
CASTing is the way you should use. Floating point numbers are inexact, they
are always stored in "scientific notation". SINGLE has a PRECISION of 7-8
digits and DOUBLE 15-16 regarless of the MAGNITUDE of the number.
0 new messages