Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.

MySQL question

I have a table that should contains a number with a decimal point in it, i.e. 59.6 but the table is displaying 60 as the number. How can I set up the table columns to reflect the correct information so that it can be pulled properly in a php script. Thanks.
You have 2 choices to fix this problem.

If your numbers are for price - change column type to DECIMAL length values "10,4" default values 0
If your numbers are for arithmetic calculations - change column type to FLOAT length values 10 default values 0.

The downside for DECIMAL is it will not handle sum well. i.e. 1/3 x 3 = 3/3 = 1, decimal will return 99.999999 instead of 1. While, the float will calculated as 1, as it is designed to handle fraction calculations.
Thread Information
Author
Posted In
Replies
2 posts
Views
102 times
Last Post
Last updated on 2 months ago
You can view all discussion threads in this forum.
You can start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
Users who participated in discussion: Chan, RaulAlonso