Bug #38852 FLOAT(M,D) description in manual different to actual behaviour
Submitted: 18 Aug 2008 12:51 Modified: 18 Aug 2008 15:40
Reporter: Thomas Tallyce Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.51a-community OS:Linux (SUSE)
Assigned to: CPU Architecture:Any

[18 Aug 2008 12:51] Thomas Tallyce
Description:
http://dev.mysql.com/doc/refman/5.1/en/numeric-types.html
says:

"MySQL allows a non-standard syntax: FLOAT(M,D)  or REAL(M,D)  or DOUBLE PRECISION(M,D). Here, “(M,D)” means than values can be stored with up to M digits in total, of which D digits may be after the decimal point.

I read this to mean that a FLOAT(5,2) field should accept and store unmodified the following example values:

123.45
1234.5
12345

The latter two cases, however, result in rounding:

123.45
999.99
999.99

So I think the documentation is wrong, or MySQL is not correctly accepting the value.

How to repeat:
See description
[18 Aug 2008 15:39] Paul DuBois
"up to M digits in total, of which D digits may be after the decimal point" means that up to M-D digits may precede the decimal point. These two values do not fit that description:

1234.5
12345