Re: Field type for american money
| From: | Shawn McKenzie | Date: | Thu, 11 Jun 2009 21:01:53 +0000 |
| Subject: | Re: Field type for american money | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-293957@lists.php.net to get a copy of this message | ||
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.
--
Thanks!
-Shawn
http://www.spidean.com