Created
October 12, 2015 11:02
-
-
Save olimortimer/38a65007235718482fed to your computer and use it in GitHub Desktop.
PHP: Round X to the nearest Y
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 | |
// Round 0.035 up to the nearest 0.01 | |
echo ceil( 0.035 / 0.01 ) * 0.01; | |
// 0.04 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment