Jump to content

[SOLVED] Tiny problem...getting ride of decimal points when using math in php.


Recommended Posts

Hey everyone,

 

I have a small problem, I own a game/website called wardeites.com and it is a mmorpg.

In this game I have tons of addition/subtraction/division/mulitplication.

Anyway...I have some values that are like for example when you pet fights with you in battle it get 10% of the experience you get.

 

$experience=$selmonster3[experience];

$petexperiene=$experience/10;

 

Okay so if the monster give 1251 experience the pet get 125 in the database, but php shows the value of 125.1 is there a way to tell php to not show decimal points to the viewers/players of my game....

 

I know I can add a new colume in the database for pet experice, but like I said this is but a very small example and I have this problem in a good 200+ places on my game...if anyone knows of a way to get the decimals not to so I'd be very appreciative...

 

 

Thanks!!!

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.