Swedish rounding for money values
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
/** | |
* 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