newttster Posted February 26, 2011 Posted February 26, 2011 I have gone around and around with this and no matter what I do I cannot figure this out. It just does not display the way it should. Okay ... on my userstats I have stats A - Q. A - G are trained and the rest are derived from the first 7. I have set up my table so that there are no decimals (int 11). Now here is my issue Stat H=the real answer is 27.5 and displays as 28 which if I understand is the way int works. :thumbup: Stat I=the real answer is 21.25 and displays as 21.75 :thumbdown: Stat J=the real answer is 21.25 and displays as 21 :thumbup: Stat K=the real answer is 18.75 and displays as 19 :thumbup: Stat L=the real answer is 18.75 and displays as 18.7500 :thumbdown: When I do a test register, I can not get it to update the table or to show the correct numbers on the loggedin.php or index.php. I am guessing it is because there is math involved. As of yet I have not figured out how to get the math to work on the register page. It does work (more or less as you can see above) on the loggedin and index pages. Any ideas? Quote
Spudinski Posted February 27, 2011 Posted February 27, 2011 It seems that you aren't only using an INT type on all of the fields in the table. Try running alter queries on all of them again. MySQL's INT type, as far as I know only support absolute numbers and not decimals. There could be other reasons, but if that doesn't work just input it with the ABS() function so that it you know that it is being converted to an absolute value. Let us know if that works, Spud Quote
newttster Posted February 27, 2011 Author Posted February 27, 2011 Djkanna and Spudinksi ... I tried both of your suggestions and they both kept returning errors. What I used instead was round(). It may seem like a really cheesy way of solving it ... but solve it, it did. Thank you both for your suggestions. Quote
rulerofzu Posted February 27, 2011 Posted February 27, 2011 round up round down....like you have found out. But you should take the previous advice and check your mysql fields and check what your doing and be consistant Quote
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.