Re: Field type for american money
| From: | Daniel Brown | Date: | Thu, 11 Jun 2009 20:10:54 +0000 |
| Subject: | Re: Field type for american money | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-293954@lists.php.net to get a copy of this message | ||
On Thu, Jun 11, 2009 at 16:08, revDAVE<Cool@hosting4days.com> wrote:
> Php - MySQL - newbie question
>
> - Field type for american money - int(11) seems to work fine
>
> - but also I tried decimal(10,2)
>
> Is one a better choice than another for american money usage?
For PHP, check out money_format(), number_format(), and sprintf()
with
%0.2f or similar. For MySQL, ask on the MySQL list. ;-P
--
</Daniel P. Brown>
daniel.brown@parasane.net || danbrown@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW10000