Jump to content

Decimal(3,2)


Donovan

Recommended Posts

If I have a Decimal(3,2) datatype, and try to enter a value such as 100 it returns 99.99.

 

Why is that?  I have a table for student grades and need to enter in either 100 or any other possible grade such as 98.60 or 87.43... etc.

 

This works with Decimal(4,2) but I don't know why.

 

According to the MySql manual page, the first number is the total number of digits, and the second number is the number of digits to the right of the decimal, so hypothetically, to do your calculations correctly, you really should use (5, 2) since 100.00 is five digits and 2 digits are past the decimal.

Link to comment
https://forums.phpfreaks.com/topic/87382-decimal32/#findComment-446972
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.