It's gives me correct result (integer value 11) on my FreeBSD 3.5, FreeBSD
4.2 and Debian Linux 2.2 Machine
----- Original Message -----
From: "Carsten H. Pedersen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; "MySQL mailinglist" <[EMAIL PROTECTED]>
Sent: Thursday, February 08, 2001 1:15 AM
Subject: RE: Bug converting string into integer
> > In a SELECT I have to convert a string into a number.
> >
> > I used to use something like 'string'+0, where 'string' is a string
> > rapresentation of an integer.
> >
> > Now I noticed that in many cases it returns a rounded floating point!!!
> >
> > For example:
> >
> > mysql> select '11'+0;
> > +-----------------+
> > | '11'+0 |
> > +-----------------+
> > | 10.999999046326 |
> > +-----------------+
> > 1 row in set (0.00 sec)
> >
> >
> > Is it normal? Or it happens only in my system? (OpenBSD 2.8 i386)
> >
> > What is the best (more efficient) way to convert an integer string to an
> > integer value?
>
>
> ROUND('number') (?)
>
> / Carsten
> --
> Carsten H. Pedersen
> keeper and maintainer of the bitbybit.dk MySQL FAQ
> http://www.bitbybit.dk/mysqlfaq
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
> http://www.mysql.com/manual.php (the manual)
> http://lists.mysql.com/ (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>
>
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php