PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
ibanez270dx
Forum Commoner
Posts: 74 Joined: Thu Jul 27, 2006 12:06 pm
Location: Everywhere, California
Post
by ibanez270dx » Fri Jul 28, 2006 12:04 pm
Hi,
Little quick question, I'm kinda pressed for time... My script has a section where it calculates an uptime percentage:
Code: Select all
$total_uptime_hrs = ($totaltime-$total_dwntime_hrs);
$uptime_percent = ($total_uptime_hrs*100);
$total_uptime_percent = ($uptime_percent/$totaltime);
When I output it, its a really long decimal. How can I round it to... lets say, 2 decimal places?
Thanks,
- Jeff
Last edited by
ibanez270dx on Fri Jul 28, 2006 12:29 pm, edited 2 times in total.
Luke
The Ninja Space Mod
Posts: 6424 Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA
Post
by Luke » Fri Jul 28, 2006 12:05 pm
LOL RTFM
ibanez270dx
Forum Commoner
Posts: 74 Joined: Thu Jul 27, 2006 12:06 pm
Location: Everywhere, California
Post
by ibanez270dx » Fri Jul 28, 2006 12:07 pm
hahaha! Well, I gotta start someplace...
Luke
The Ninja Space Mod
Posts: 6424 Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA
Post
by Luke » Fri Jul 28, 2006 12:09 pm
No problem it was just sorta funny...