BIS fnc ordinalNumber: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "\{\{ *codecomment *\| *\/\/ *([^ ]+) *\}\} " to "{{cc|$1}}") |
Lou Montana (talk | contribs) m (revert + fix) |
||
Line 1: | Line 1: | ||
{{RV|type=function | {{RV|type=function | ||
| arma3 | |game1= arma3 | ||
|1.00 | |version1= 1.00 | ||
|gr1 = Strings | |gr1= Strings | ||
| Return number as ordinal number (e.g. 1 become "1st") | |descr= Return number as ordinal number (e.g. 1 become "1st") | ||
| [number, language, isFeminine] call [[BIS_fnc_ordinalNumber]] | |s1= [number, language, isFeminine] call [[BIS_fnc_ordinalNumber]] | ||
|p1= number: [[Number]] | |p1= number: [[Number]] | ||
Line 17: | Line 17: | ||
|p3= isFeminine: [[Boolean]] - (Optional, default [[false]]) | |p3= isFeminine: [[Boolean]] - (Optional, default [[false]]) | ||
| [[String]] | |r1= [[String]] | ||
|x1= <code>_second = [42] [[call]] [[BIS_fnc_ordinalNumber]]; {{ | |x1= <code>_second = [42] [[call]] [[BIS_fnc_ordinalNumber]]; {{cc|will return "42nd" for English-speaking players}}</code> | ||
|x2= <code>_num1enm = [1, "English", [[false]]] [[call]] [[BIS_fnc_ordinalNumber]]; {{cc| returns "1st"}}_num1frm = [1, "French", [[false]]] [[call]] [[BIS_fnc_ordinalNumber]]; {{cc| returns "1er"}}_num1frw = [1, "French", [[true]]] [[call]] [[BIS_fnc_ordinalNumber]]; {{cc| returns "1re"}}_num1esm = [1, "Spanish", [[false]]] [[call]] [[BIS_fnc_ordinalNumber]]; {{cc| returns "1"}}_num1esw = [1, "Spanish", [[true]]] [[call]] [[BIS_fnc_ordinalNumber]]; {{ | |x2= <code>_num1enm = [1, "English", [[false]]] [[call]] [[BIS_fnc_ordinalNumber]]; {{cc|returns "1st"}} | ||
_num1frm = [1, "French", [[false]]] [[call]] [[BIS_fnc_ordinalNumber]]; {{cc|returns "1er"}} | |||
_num1frw = [1, "French", [[true]]] [[call]] [[BIS_fnc_ordinalNumber]]; {{cc|returns "1re"}} | |||
_num1esm = [1, "Spanish", [[false]]] [[call]] [[BIS_fnc_ordinalNumber]]; {{cc|returns "1"}} | |||
_num1esw = [1, "Spanish", [[true]]] [[call]] [[BIS_fnc_ordinalNumber]]; {{cc|returns "1*" for Portuguese, Italian and Spanish}}</code> | |||
|x3= <code>_num1en = [1, "English"] [[call]] [[BIS_fnc_ordinalNumber]]; {{cc| returns "1st"}} | |x3= <code>_num1en = [1, "English"] [[call]] [[BIS_fnc_ordinalNumber]]; {{cc| returns "1st"}} | ||
_num2en = [2, "English"] [[call]] [[BIS_fnc_ordinalNumber]]; {{cc|returns "2nd"}} | |||
_num3en = [3, "English"] [[call]] [[BIS_fnc_ordinalNumber]]; {{cc|returns "3rd"}} | |||
_num4en = [4, "English"] [[call]] [[BIS_fnc_ordinalNumber]]; {{cc|returns "4th"}} | |||
_num9en = [9, "English"] [[call]] [[BIS_fnc_ordinalNumber]]; {{cc|returns "9th"}}</code> | |||
|x4= <code>_second = [1, "unknownLanguage"] [[call]] [[BIS_fnc_ordinalNumber]]; {{ | |x4= <code>_second = [1, "unknownLanguage"] [[call]] [[BIS_fnc_ordinalNumber]]; {{cc|will return "1." if language is not recognised/supported}}</code> | ||
| [[language]] | |seealso= [[language]] | ||
}} | }} | ||
Revision as of 19:06, 29 January 2021
Description
Syntax
- Syntax:
- [number, language, isFeminine] call BIS_fnc_ordinalNumber
- Parameters:
- number: Number
- language: String - (Optional, current game language)
- isFeminine: Boolean - (Optional, default false)
- Return Value:
- String
Examples
- Example 1:
_second = [42] call BIS_fnc_ordinalNumber; // will return "42nd" for English-speaking players
- Example 2:
_num1enm = [1, "English", false] call BIS_fnc_ordinalNumber; // returns "1st" _num1frm = [1, "French", false] call BIS_fnc_ordinalNumber; // returns "1er" _num1frw = [1, "French", true] call BIS_fnc_ordinalNumber; // returns "1re" _num1esm = [1, "Spanish", false] call BIS_fnc_ordinalNumber; // returns "1" _num1esw = [1, "Spanish", true] call BIS_fnc_ordinalNumber; // returns "1*" for Portuguese, Italian and Spanish
- Example 3:
_num1en = [1, "English"] call BIS_fnc_ordinalNumber; // returns "1st" _num2en = [2, "English"] call BIS_fnc_ordinalNumber; // returns "2nd" _num3en = [3, "English"] call BIS_fnc_ordinalNumber; // returns "3rd" _num4en = [4, "English"] call BIS_fnc_ordinalNumber; // returns "4th" _num9en = [9, "English"] call BIS_fnc_ordinalNumber; // returns "9th"
- Example 4:
_second = [1, "unknownLanguage"] call BIS_fnc_ordinalNumber; // will return "1." if language is not recognised/supported
Additional Information
- See also:
- language
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note