Re: Field type for american money

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Robert Cummings wrote:
> Shawn McKenzie wrote:
>> Waynn Lue wrote:
>>> For mysql, it's better to use int and then store it in cents (or
>>> micros) so you can use all integer operations instead of float ones.
>>>
>>
>> To each his own.  Speed or otherwise I don't see a difference between:
>>
>> $total = 19.95 + 3.99; //shipping
>>
>> and
>>
>> $total = 1995 + 399; //shipping
>>
>> Except with the ints you have to format them for display.
> 
> You have to format the floats too:
> 
> <?php
> 
>     $total = 5.55 + 9.35;
>     echo $total."\n";
> 
> ?>
> 
> Cheers,
> Rob.

Yeah, yeah, yeah...

I guess what I meant to say was that I had never really considered using
ints :-)

-- 
Thanks!
-Shawn
http://www.spidean.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux