summaryrefslogtreecommitdiff
path: root/kohana/helpers/num.php
diff options
context:
space:
mode:
Diffstat (limited to 'kohana/helpers/num.php')
-rw-r--r--kohana/helpers/num.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/kohana/helpers/num.php b/kohana/helpers/num.php
new file mode 100644
index 00000000..62516e81
--- /dev/null
+++ b/kohana/helpers/num.php
@@ -0,0 +1,26 @@
+<?php defined('SYSPATH') or die('No direct script access.');
+/**
+ * Number helper class.
+ *
+ * $Id$
+ *
+ * @package Core
+ * @author Kohana Team
+ * @copyright (c) 2007-2008 Kohana Team
+ * @license http://kohanaphp.com/license.html
+ */
+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