From 11954d2521475f6964bfa9c65dcd2f3e53a65af5 Mon Sep 17 00:00:00 2001 From: George Petculescu Date: Thu, 20 Oct 2016 20:53:11 +0300 Subject: moved ordinal_format() helper function from Number helper to Inflector helper --- user_guide_src/source/helpers/inflector_helper.rst | 17 ++++++++++++++++- user_guide_src/source/helpers/number_helper.rst | 17 +---------------- 2 files changed, 17 insertions(+), 17 deletions(-) (limited to 'user_guide_src/source/helpers') diff --git a/user_guide_src/source/helpers/inflector_helper.rst b/user_guide_src/source/helpers/inflector_helper.rst index df0c568c0..8a6ca7a92 100644 --- a/user_guide_src/source/helpers/inflector_helper.rst +++ b/user_guide_src/source/helpers/inflector_helper.rst @@ -93,4 +93,19 @@ The following functions are available: Checks if the given word has a plural version. Example:: - is_countable('equipment'); // Returns FALSE \ No newline at end of file + is_countable('equipment'); // Returns FALSE + +.. php:function:: ordinal_format($number) + + :param int $number: natural number to be converted + :returns: Ordinal numeral for given number or FALSE 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:: + + echo ordinal_format(1); // Returns 1st + echo ordinal_format(3); // Returns 3rd + echo ordinal_format(21); // Returns 21st + echo ordinal_format(102); // Returns 102nd diff --git a/user_guide_src/source/helpers/number_helper.rst b/user_guide_src/source/helpers/number_helper.rst index 47f616690..9d5e98cfb 100644 --- a/user_guide_src/source/helpers/number_helper.rst +++ b/user_guide_src/source/helpers/number_helper.rst @@ -49,19 +49,4 @@ 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//number_lang.php* - -.. php:function:: ordinal_format($number) - - :param int $number: natural number to be converted - :returns: Ordinal numeral for given number or FALSE 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:: - - echo ordinal_format(1); // Returns 1st - echo ordinal_format(3); // Returns 3rd - echo ordinal_format(21); // Returns 21st - echo ordinal_format(102); // Returns 102nd + language file: *language//number_lang.php* \ No newline at end of file -- cgit v1.2.3-24-g4f1b