Created
March 13, 2012 15:16
-
-
Save jbrooksuk/2029362 to your computer and use it in GitHub Desktop.
Calculates a percentage off of a price, then rounds to the next 9.
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 | |
function calcPPrice($iPrice, $iDPrice = 1) { | |
$iDiscounted = round($iPrice - ($iPrice / 100 * $iDPrice)); | |
return $iDiscounted - (10 - (9 - ($iDiscounted % 10))); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment