Mark Goodge wrote:

This is the sort of thing that is far better handled in the application layer, rather than the database layer. PHP, for example, even has a built-in function which will do this:

setype($value,"float");


I agree about using the application layer, but I like to use type casting instead.

$value = (float) $value;


http://www.php.net/manual/en/language.types.type-juggling.php#language.types.typecasting

I try to avoid asking why but in this case I have to. I can't imagine wanting to have a list of numbers displayed and not have them all aligned right with the sane number of digits after the decimal point. So why would you even want to do this is?

Chris W

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=arch...@jab.org

Reply via email to