summaryrefslogtreecommitdiff
path: root/system/helpers/num.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/helpers/num.php')
-rw-r--r--system/helpers/num.php24
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