Last active
August 29, 2015 13:57
-
-
Save hafizbadrie/9616300 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/* finding top ordinate value in a graph */ | |
/* let's say $a is the highest value in data */ | |
$a = 25; | |
$base = pow(10, (strlen($a) - 1)); | |
$max = floor($a/$base) * $base; | |
$mod = $max%3; | |
$addition = ($mod == 0) ? 0 : 3 - $mod; | |
$max += $base * $addition; | |
echo $max; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment