diff options
| author | Tristan Zur <tzur@webserver.ccwn.org> | 2015-06-10 20:55:53 +0200 |
|---|---|---|
| committer | Tristan Zur <tzur@webserver.ccwn.org> | 2015-06-10 20:55:53 +0200 |
| commit | 406abd7c4df1ace2cd3e4e17159e8941a2e8c0c4 (patch) | |
| tree | a324be16021f44f2fd6d55e609f47024e945b1db /system/helpers/num.php | |
Initial import
Diffstat (limited to 'system/helpers/num.php')
| -rw-r--r-- | system/helpers/num.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/system/helpers/num.php b/system/helpers/num.php new file mode 100644 index 0000000..c9e9843 --- /dev/null +++ b/system/helpers/num.php @@ -0,0 +1,24 @@ +<?php defined('SYSPATH') OR die('No direct access allowed.'); +/** + * Number helper class. + * + * @package Kohana + * @author Kohana Team + * @copyright (c) 2007-2009 Kohana Team + * @license http://kohanaphp.com/license + */ +class num_Core { + + /** + * Round a number to the nearest nth + * + * @param integer number to round + * @param integer number to round to + * @return integer + */ + public static function round($number, $nearest = 5) + { + return round($number / $nearest) * $nearest; + } + +} // End num
\ No newline at end of file |
