Wakan wrote:
I bag your pardon if I post this question again,
but I can't find a clear answer.
I've Mysql version 3.23.41 and 4.0.12, and the manual says
that for version > 3.23 the - sign and the decimal point, there's an extra space reserved.
I've a decimal column : DECIMAL(5,2), and my problem (maybe manual misunderstand)
comes out from both my installed version.


If I put 8000  ---> it writes correctly 8000,00.
If I put -8000 ---> it writes -999,99

why this???
thanks
Carlo



According to the manual
(http://www.mysql.com/doc/en/Numeric_types.html):

"The NUMERIC and DECIMAL types are implemented as the same type by MySQL, as permitted by the SQL-92 standard. They are used for values for which it is important to preserve exact precision, for example with monetary data. When declaring a column of one of these types the precision and scale can be (and usually is) specified; for example:

salary DECIMAL(5,2)

In this example, 5 (precision) represents the number of significant decimal digits that will be stored for values, and 2 (scale) represents the number of digits that will be stored following the decimal point. In this case, therefore, the range of values that can be stored in the salary column is from -99.99 to 99.99. (MySQL can actually store numbers up to 999.99 in this column because it doesn't have to store the sign for positive numbers) "

My understanding is that the range of allowed values for DECIMAL(5,2) is
-99.99 to 99.99 (although mysql MAY accept some values beyond these
limits).
Since your values are clearly out of this range, you should revue your
field specification.
Maybe DECIMAL(7,2) would be better ?

Hope this helps
Joseph Bueno


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to