At 10:57 -0700 7/30/02, Desmond Lee wrote:
>Thanks for your reply
>Just to check the decimal(6, 2) means show 6 digits to the 2
>decimals of percision. Thus you get a numbers like:
>Is that correct?
That is not correct. DECIMAL(6,2) means 6 digits *total*, of which two
are to the right of the decimal point. This means that 1.34 and 3344.92
are okay, but 300000.00 is not.
> Why do you not use a float and a decmial type?
DECIMAL gives you perfect accuracy to the number of decimals specified,
with no roundoff error, for one thing. That's why it's good for monetary
calculations. On the other hand, it's stored internally as a character
string, so DECIMAL operations are not as fast as operations with native
>>From: "Mike(mickako)Blezien" <mickalo@stripped>
>>To: Desmond Lee <desmond60@stripped>
>>Subject: Re: currency type
>>Date: Tue, 30 Jul 2002 11:36:30 -0500
>>>>Desmond Lee wrote:
>>> Hi there
>>> Does mysql have a currency type, or is it best to just use a varchar or a
>>I normally use the DECIMAL(6,2) data type, works very for currency values.
>>Thunder Rain Internet Publishing
>>Providing Internet Solutions that work!