Last active
December 28, 2015 19:29
-
-
Save sscovil/7550289 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Percent | |
* | |
* @param $a integer Number that represents 100%. | |
* @param $b integer Number to compare to $a. | |
* | |
* @return string Number B as a percentage of Number A. | |
*/ | |
public static function percent( $a, $b ) { | |
return intval( ( $b / $a ) * 100 ) . "%"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment