Calculate percent from value
Posted on August 31, 2008, Filled under PHP,
Bookmark it
Here’s how you can calculate the percent from a value.
<?php /* Credits: http://www.bitrepository.com */ // example: number of employees in a company's department (Marketing) $value = '20'; // total employees that company has $total = '500'; $percent = number_format(($value * 100) / $total); // percent of employees from the Marketing Department. echo $percent.'%'; ?>
Do you wish to receive the latest updates as soon as they are posted? Get our RSS Feed or Subscribe to the Newsletter!
- August 31, 2008
- article by Gabriel C.
- Leave a reply!
Sponsors
Related Posts
-
Calculating value from percentat August 31, 2008 with 1 comment
-
Create, Customize and Send Newsletters: MeeNewsat August 3, 2009 with 1 comment
-
PHP: Calculate the Size, Number of Files & Folders of a Directoryat September 24, 2008 with 3 comments
-
Download ‘Affiliate Marketing 101′: Free Guideat February 28, 2010
