On Thu, Jun 11, 2009 at 4:08 PM, revDAVE 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?
>
>
> --
> Thanks - RevDave
> Cool @ hosting4days .
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:
>>
>> $to
>
> 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
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 =
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; //shipp
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.
On 6/11/09, Shawn McKenzie wrote:
> revDAVE wrote:
>> Php - MySQL - newbie question
>>
>> - Field type for american money - int(11) seems to work fine
>>
>> - but
On Thu, Jun 11, 2009 at 16:08, revDAVE 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
7 matches
Mail list logo