xstevex Posted January 3, 2008 Share Posted January 3, 2008 Hi, I was instructed by someone to do some modifications to my database, now I can't get in contact with him to ask some more questions. What he said was: "...First, you have to change the database rating to type Double, length 7 dec 6." The "rating" is the name of the field. And I know "Double" is set in Type. What I don't know is "length 7 dec 6" but I assume this refers to the Length/Values settings. If so would I type this in as "7.6"? I have no idea. Please advise if you know what "length 7 dec 6" would mean. ??? Steve Quote Link to comment https://forums.phpfreaks.com/topic/84259-solved-lengthvalues-what-on-earth-is-it/ Share on other sites More sharing options...
fenway Posted January 3, 2008 Share Posted January 3, 2008 The length of decimals fields includes all sig-figs... so you need to "decide" how many to allocate to decimal places. Quote Link to comment https://forums.phpfreaks.com/topic/84259-solved-lengthvalues-what-on-earth-is-it/#findComment-429280 Share on other sites More sharing options...
xstevex Posted January 3, 2008 Author Share Posted January 3, 2008 Hi Fenway, Thanks for your answer. So I would have the significant figures set to 7 and the decimals of those "sig-figs" would be 6. So seven figures total, of which six would be decimals. One integer and six decimals. How do I tell this to MySql in the Length/Values area? I'm guessing I write it in as "7,6" Steve. Quote Link to comment https://forums.phpfreaks.com/topic/84259-solved-lengthvalues-what-on-earth-is-it/#findComment-429339 Share on other sites More sharing options...
revraz Posted January 3, 2008 Share Posted January 3, 2008 Yes Quote Link to comment https://forums.phpfreaks.com/topic/84259-solved-lengthvalues-what-on-earth-is-it/#findComment-429342 Share on other sites More sharing options...
xstevex Posted January 3, 2008 Author Share Posted January 3, 2008 Ok, thank you. I learnt something new today. Steve Quote Link to comment https://forums.phpfreaks.com/topic/84259-solved-lengthvalues-what-on-earth-is-it/#findComment-429349 Share on other sites More sharing options...
revraz Posted January 3, 2008 Share Posted January 3, 2008 From this link: http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html 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. For example, a column defined as FLOAT(7,4) will look like -999.9999 when displayed. MySQL performs rounding when storing values, so if you insert 999.00009 into a FLOAT(7,4) column, the approximate result is 999.0001. Quote Link to comment https://forums.phpfreaks.com/topic/84259-solved-lengthvalues-what-on-earth-is-it/#findComment-429361 Share on other sites More sharing options...
xstevex Posted January 3, 2008 Author Share Posted January 3, 2008 Thanks Revraz, This will be useful to know in the future. Quote Link to comment https://forums.phpfreaks.com/topic/84259-solved-lengthvalues-what-on-earth-is-it/#findComment-429380 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.