> 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

Reply via email to