Jump to content

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


WarDeities

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

Archived

This topic is now archived and is closed to further replies.

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