Jump to content

Recommended Posts

Hey guys,

 

My friends and I have a project going on currently and one of our mates has designed a system up for leveling up, items and such. (oh it's a game project)

 

The way hes done it is with percent (which annoys me, but it's possible I'm sure), 1 being 100% 0.2 being 20% ect.

 

Now all values are stored in a database, we have a lot of calculations going on, so I want to make sure before the table is updated all values are 2 decimal points I think e.g 0.20 or 0.02 <- never go past those 2 digits.  Now I've seen float() used for this I believe?  Do all math kind of things have to be functions?

 

Cheers,

Pengu.

Link to comment
https://forums.phpfreaks.com/topic/167058-solved-decimal-point-questions/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.