QuickTopic (SM) free message boards QuickTopic (SM) free message boards
Skip to Messages
  Sign In to access your topic list  |New Topic |My Topics|Profile
Upgrade to Pro   Customize, show pictures, add an intro, and more:   QuickTopic Pro...and check out QuickThreadSM
Topic: Storing fixed point numbers in MySQL
Views: 3370, Unique: 1689 
Subscribers: 1
What's
this?
Printer-Friendly Page
Subscribe to get & post, or stop messages by email Subscribe
All messages    << 7-16  6-6 of 16  1-5 >>
About these ads
Who | When
Messagessort recent-top   
Post a new message
 
jim winstead  6
01-02-2005 11:55 PM ET (US)
the scale (the second number in the type declaration) is not the number of digits that *can be* after the decimal point, it is the number of digits that *are* after the decimal point. you're specifying a value out of range for that column, so mysql is storing it as the maximum value for that column.

with mysql 4.1, you can do a 'SHOW WARNINGS' and see:

| Warning | 1264 | Data truncated; out of range for column 'example_num' at row 1 |

with mysql 5.0, you can turn on 'STRICT' mode to have it produce an error on such conditions.

mysql's decimal handling is less than perfect when it comes to performing calculations, because it falls back to using the system's floating point operations. this is also being addressed in mysql 5.0.
RSS link What's this?
All messages    << 7-16  6-6 of 16  1-5 >>
QuickTopicSM message boards
Over 200,000 topics served
Learn more Frequently asked questions  Acknowledgements
What they're saying about QuickTopic
 Questions, comments, or suggestions? Contact Us
Read our use policy before beginning. We value your privacy; please read our privacy statement.
Copyright ©1999-2008 Internicity Inc. All rights reserved.