summaryrefslogtreecommitdiffstats
path: root/user_guide_src
diff options
context:
space:
mode:
Diffstat (limited to 'user_guide_src')
-rw-r--r--user_guide_src/source/helpers/number_helper.rst17
1 files changed, 16 insertions, 1 deletions
diff --git a/user_guide_src/source/helpers/number_helper.rst b/user_guide_src/source/helpers/number_helper.rst
index 9d5e98cfb..20acdec18 100644
--- a/user_guide_src/source/helpers/number_helper.rst
+++ b/user_guide_src/source/helpers/number_helper.rst
@@ -49,4 +49,19 @@ The following functions are available:
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
+ language file: *language/<your_lang>/number_lang.php*
+
+.. php:function:: ordinal_format($number)
+
+ :param int $number: Non-negative natural number to be converted
+ :returns: Ordinal numeral for given number or FALSE on failure
+ :rtype: string
+
+ Returns the ordinal numeral (1st, 2nd, 3rd etc.) for a
+ non-negative natural number. If the input is not a natural number
+ greater than 0, the function will return boolean FALSE. Examples::
+
+ echo ordinal_format(1); // Returns 1st
+ echo ordinal_format(3); // Returns 3rd
+ echo ordinal_format(21); // Returns 21st
+ echo ordinal_format(102); // Returns 102nd