29 messages in com.mysql.lists.win32Re: ROUND - OS-independent workaraoun...
FromSent OnAttachments
Peter Holm04 Apr 2001 19:12 
David Peoples04 Apr 2001 22:13 
Ralph Mason04 Apr 2001 22:48 
René Tegel04 Apr 2001 23:10 
Sinisa Milivojevic05 Apr 2001 03:55 
David Patte05 Apr 2001 04:05 
Cynic05 Apr 2001 04:17 
Thimble Smith05 Apr 2001 11:26 
Ralph Mason05 Apr 2001 13:00 
Tim Endres05 Apr 2001 13:32 
Pete Harlan05 Apr 2001 19:43 
Jupiter wekwa Punungwe06 Apr 2001 00:08 
Luc Van der Veken06 Apr 2001 01:36 
Jupiter wekwa Punungwe06 Apr 2001 06:49 
Jupiter wekwa Punungwe06 Apr 2001 07:19 
Pete French06 Apr 2001 07:52 
Thimble Smith06 Apr 2001 07:59 
dpa...@relativedata.com06 Apr 2001 08:05 
Pete French06 Apr 2001 08:58 
René Tegel06 Apr 2001 09:17 
Tim Endres06 Apr 2001 09:42 
Pete French06 Apr 2001 10:25 
Tim Endres06 Apr 2001 11:20 
Luc Van der Veken09 Apr 2001 01:55 
Peter Holm11 Apr 2001 09:12 
René Tegel11 Apr 2001 09:31 
René Tegel11 Apr 2001 09:34 
René Tegel12 Apr 2001 11:08 
Luc Van der Veken13 Apr 2001 00:53 
Subject:Re: ROUND - OS-independent workaraound? (dazed and confused)
From:René Tegel (teg@dubaron.com)
Date:04/12/2001 11:08:41 AM
List:com.mysql.lists.win32

hi,

you're quite right, negative will do wrong rounding.

select if(f<0, -floor(-f+0.5), floor(f+0.5)) from thetable;

works fine.... or is floor() OS dependent as well?

regards,

rene

----- Original Message ----- From: "Ralph Mason" <ralp@telogis.com> To: "René Tegel" <teg@dubaron.com> Sent: Thursday, April 12, 2001 5:11 AM Subject: Re: ROUND - OS-independent workaraound? (dazed and confused)

Unless f is < 0.

Then this function fails.

You could use a udf.

well, this example should be: select floor(1.5 + 0.5); since mysql has some problems with the space between the function name and the parameters...

select floor (f + 0.5); will do the trick.