Jump to content
MakeWebGames

Recommended Posts

Posted

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?

Posted

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

Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...