BIS fnc ordinalNumber: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (1 revision)
(Page filling)
Line 1: Line 1:
{{Function|= Comments
{{Function|= Comments
____________________________________________________________________________________________
____________________________________________________________________________________________
Line 8: Line 7:
____________________________________________________________________________________________
____________________________________________________________________________________________


| <pre>/*
| Return number as ordinal number (e.g. 1 become "1st") |= Description
____________________________________________________________________________________________


Description:
| [number, language, isFeminine] call [[BIS_fnc_ordinalNumber]] |= Syntax
Return number as ordinal number (e.g. 1 become "1st")


Parameter(s):
|p1= number: [[Number]] |= Parameter 1
0: NUMBER
1 (Optional): STRING - language (default: current game language)
2 (Optional): BOOL - true for feminine gender, false for masculine (default: false)


Returns:
|p2= language: [[String]] - (Optional, current game [[language]]) |= Parameter 2
STRING
 
*/
|p3= isFeminine: [[Boolean]] - (Optional, default [[false]]) |= Parameter 3
</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
 
| [[String]] |= Return value
____________________________________________________________________________________________
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_ordinalNumber]]; --> |= Syntax
|x1= <code>_second = [42] [[call]] [[BIS_fnc_ordinalNumber]]; {{codecomment|// will return "42nd" for English-speaking players}}</code> |= Example 1


|p1= |= Parameter 1
|x2= <code>_num1enm = [1, "English", [[false]]] [[call]] [[BIS_fnc_ordinalNumber]]; {{codecomment|// returns "1st"}}
_num1frm = [1, "French",&nbsp; [[false]]] [[call]] [[BIS_fnc_ordinalNumber]]; {{codecomment|// returns "1er"}}
_num1frw = [1, "French",&nbsp; &nbsp;[[true]]] [[call]] [[BIS_fnc_ordinalNumber]]; {{codecomment|// returns "1re"}}
_num1esm = [1, "Spanish", [[false]]] [[call]] [[BIS_fnc_ordinalNumber]]; {{codecomment|// returns "1"}}
_num1esw = [1, "Spanish", &nbsp;[[true]]] [[call]] [[BIS_fnc_ordinalNumber]]; {{codecomment|// returns "1*" for Portuguese, Italian and Spanish}}</code> |= Example 2


| |= Return value
|x3= <code>_num1en = [1, "English"] [[call]] [[BIS_fnc_ordinalNumber]]; {{codecomment|// returns "1st"}}
____________________________________________________________________________________________
_num1en = [2, "English"] [[call]] [[BIS_fnc_ordinalNumber]]; {{codecomment|// returns "2nd"}}
_num1en = [3, "English"] [[call]] [[BIS_fnc_ordinalNumber]]; {{codecomment|// returns "3rd"}}
_num1en = [4, "English"] [[call]] [[BIS_fnc_ordinalNumber]]; {{codecomment|// returns "4th"}}
_num1en = [9, "English"] [[call]] [[BIS_fnc_ordinalNumber]]; {{codecomment|// returns "9th"}}</code> |= Example 3


|x1= <code></code> |=  
|x4= <code>_second = [1, "unknownLanguage"] [[call]] [[BIS_fnc_ordinalNumber]]; {{codecomment|// will return "1." if language is not recognised/supported}}</code> |= Example 4
____________________________________________________________________________________________
____________________________________________________________________________________________


| |= See also
| [[language]] |= See also


}}
}}

Revision as of 01:14, 7 May 2018

Hover & click on the images for description

Description

Description:
Return number as ordinal number (e.g. 1 become "1st")
Execution:
call
Groups:
Uncategorised

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" _num1en = [2, "English"] call BIS_fnc_ordinalNumber; // returns "2nd" _num1en = [3, "English"] call BIS_fnc_ordinalNumber; // returns "3rd" _num1en = [4, "English"] call BIS_fnc_ordinalNumber; // returns "4th" _num1en = [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

Notes

Bottom Section