Created
September 5, 2014 13:22
-
-
Save PhiSYS/505c924ad187e3dda151 to your computer and use it in GitHub Desktop.
Swedish rounding for money values
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
/** | |
* Swedish rounding $nearest | |
* | |
* @param float $num | |
* @param float $nearest | |
* @return float | |
*/ | |
function roundcent($num, $nearest = .05){ // default 5 cent | |
return round($num / $nearest) * $nearest; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment