summaryrefslogtreecommitdiffstats
path: root/user_guide_src
diff options
context:
space:
mode:
authorGeorge Petculescu <gxgpet@gmail.com>2016-10-20 20:03:38 +0200
committerGeorge Petculescu <gxgpet@gmail.com>2016-10-20 20:03:38 +0200
commit03a1eac3b7bed8ed6df59109364a3eebe3f1cceb (patch)
treedaace20d5d97648c12eab042d7224d51a963c5e1 /user_guide_src
parent4fe5e99f437fe79cc40cebd08277eb319d8a6095 (diff)
ordinal_format will accept only non-negative natural numbers and return original value on failure + docs update regarding this.
Diffstat (limited to 'user_guide_src')
-rw-r--r--user_guide_src/source/helpers/inflector_helper.rst11
1 files changed, 6 insertions, 5 deletions
diff --git a/user_guide_src/source/helpers/inflector_helper.rst b/user_guide_src/source/helpers/inflector_helper.rst
index 8a6ca7a92..76cce6f4d 100644
--- a/user_guide_src/source/helpers/inflector_helper.rst
+++ b/user_guide_src/source/helpers/inflector_helper.rst
@@ -97,15 +97,16 @@ The following functions are available:
.. php:function:: ordinal_format($number)
- :param int $number: natural number to be converted
- :returns: Ordinal numeral for given number or FALSE on failure
+ :param int $number: non-negative natural number to be converted
+ :returns: Ordinal numeral for given number or original value on failure
:rtype: string
- Returns the ordinal numeral (0th, 1st, 2nd, 3rd etc.) for a
- natural number. If the input is not a natural number, the
- function will return boolean FALSE. Examples::
+ 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 the original value. 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
+ echo ordinal_format(-5); // Invalid input, will return -5