List:General Discussion« Previous MessageNext Message »
From:Chris W Date:July 20 2010 4:07pm
Subject:Re: Decimal points
View as plain text  
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
Thread
Decimal pointsAshley M. Kirchner19 Jul
  • Re: Decimal pointsMark Goodge19 Jul
    • Re: Decimal pointsChris W20 Jul
      • Re: [MySQL] Re: Decimal pointsAshley M. Kirchner20 Jul
        • RE: [MySQL] Re: Decimal pointsSteven Staples20 Jul
  • RE: Decimal pointsSamrat Kar19 Jul
Re: Decimal pointsNguyen Manh Cuong19 Jul