diff options
author | Andrew <browner12@gmail.com> | 2014-02-11 09:55:48 +0100 |
---|---|---|
committer | Andrew <browner12@gmail.com> | 2014-02-11 09:55:48 +0100 |
commit | b6d8b962e44202a74c9b9321a4a53f61a753fccf (patch) | |
tree | 2d3c533a55964a0d124f7cd6bb1d3d98c7b84056 /user_guide_src/source/helpers/number_helper.rst | |
parent | 41713aaa665189dd0a191c333c73c4a7b9f37c78 (diff) | |
parent | 29e12641a1bb952f493462db6757ae12c7da1f2c (diff) |
Merge branch 'develop' into patch-1
Conflicts:
system/libraries/Calendar.php
Diffstat (limited to 'user_guide_src/source/helpers/number_helper.rst')
-rw-r--r-- | user_guide_src/source/helpers/number_helper.rst | 55 |
1 files changed, 31 insertions, 24 deletions
diff --git a/user_guide_src/source/helpers/number_helper.rst b/user_guide_src/source/helpers/number_helper.rst index 8e0ebda5e..2de4457d9 100644 --- a/user_guide_src/source/helpers/number_helper.rst +++ b/user_guide_src/source/helpers/number_helper.rst @@ -5,7 +5,12 @@ Number Helper The Number Helper file contains functions that help you work with numeric data. -.. contents:: Page Contents +.. contents:: + :local: + +.. raw:: html + + <div class="custom-index container"></div> Loading this Helper =================== @@ -14,32 +19,34 @@ This helper is loaded using the following code:: $this->load->helper('number'); +Available Functions +=================== + The following functions are available: -byte_format() -============= -.. php:function:: byte_format($num, $precision = 1) +.. 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(123456789123456789); // Returns 11,228.3 TB - -An optional second parameter allows you to set the precision of the -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`
\ No newline at end of file + :returns: Formatted data size string + :rtype: 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(123456789123456789); // Returns 11,228.3 TB + + An optional second parameter allows you to set the precision of the + 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*
\ No newline at end of file |