summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/helpers/number_helper.rst
diff options
context:
space:
mode:
authorJonathon Hill <jhill@brandmovers.com>2012-11-12 14:51:41 +0100
committerJonathon Hill <jhill@brandmovers.com>2012-11-12 14:51:41 +0100
commit3978fc33d82dd7f778d1adbf30744f4dfac41c25 (patch)
treef32be1ae610f0cfeff65c35abecd14e8ea5cadc6 /user_guide_src/source/helpers/number_helper.rst
parent275cf274860c6ed181d50b398efd3a21d7ba9135 (diff)
parenta9ab46d7a031bda304eb9b6658ffaf693b8d9bcb (diff)
Merge remote-tracking branch 'upstream/develop' into develop
Conflicts: user_guide_src/source/changelog.rst Signed-off-by: Jonathon Hill <jhill@brandmovers.com>
Diffstat (limited to 'user_guide_src/source/helpers/number_helper.rst')
-rw-r--r--user_guide_src/source/helpers/number_helper.rst32
1 files changed, 16 insertions, 16 deletions
diff --git a/user_guide_src/source/helpers/number_helper.rst b/user_guide_src/source/helpers/number_helper.rst
index af6cdad57..8e0ebda5e 100644
--- a/user_guide_src/source/helpers/number_helper.rst
+++ b/user_guide_src/source/helpers/number_helper.rst
@@ -10,9 +10,7 @@ numeric data.
Loading this Helper
===================
-This helper is loaded using the following code
-
-::
+This helper is loaded using the following code::
$this->load->helper('number');
@@ -21,25 +19,27 @@ The following functions are available:
byte_format()
=============
-Formats a numbers as bytes, based on size, and adds the appropriate
-suffix. Examples
+.. php:function:: byte_format($num, $precision = 1)
+
+ :param mixed $num: Number of bytes
+ :param int $precision: Floating point precision
+ :returns: string
-::
+Formats numbers as bytes, based on size, and adds the appropriate
+suffix. Examples::
- echo byte_format(456); // Returns 456 Bytes
- echo byte_format(4567); // Returns 4.5 KB
- echo byte_format(45678); // Returns 44.6 KB
- echo byte_format(456789); // Returns 447.8 KB
- echo byte_format(3456789); // Returns 3.3 MB
- echo byte_format(12345678912345); // Returns 1.8 GB
+ echo byte_format(456); // Returns 456 Bytes
+ echo byte_format(4567); // Returns 4.5 KB
+ echo byte_format(45678); // Returns 44.6 KB
+ echo byte_format(456789); // Returns 447.8 KB
+ echo byte_format(3456789); // Returns 3.3 MB
+ echo byte_format(12345678912345); // Returns 1.8 GB
echo byte_format(123456789123456789); // Returns 11,228.3 TB
An optional second parameter allows you to set the precision of the
-result.
-
-::
+result::
echo byte_format(45678, 2); // Returns 44.61 KB
.. note:: The text generated by this function is found in the following
- language file: language/<your_lang>/number_lang.php
+ language file: `language/<your_lang>/number_lang.php` \ No newline at end of file