BIS fnc parseNumberSafe: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Text replacement - " *\| *([Cc]omments|COMMENTS|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments \("local" or "global"\)|Multiplayer Effects \("local" or "global"\)|Multiplayer Execution \("server" o...)
Line 5: Line 5:
|version1= 1.95
|version1= 1.95


|gr1 = Arrays |GROUP1=
|gr1 = Arrays


|descr= Converts expression into a number. Can also convert array of expressions into an array of numbers.<br>
|descr= Converts expression into a number. Can also convert array of expressions into an array of numbers.<br>
Line 14: Line 14:
|p1= input: [[Number]], [[String]], [[Array]], [[Side]], [[Config]] or [[Array]] of those data types
|p1= input: [[Number]], [[String]], [[Array]], [[Side]], [[Config]] or [[Array]] of those data types


|r1= [[Number]] or [[Array|array]] of [[Number|numbers]] if [[Array|array]] is passed as an argument|Return value=
|r1= [[Number]] or [[Array|array]] of [[Number|numbers]] if [[Array|array]] is passed as an argument


|x1= <code><nowiki>[</nowiki>[[safeZoneX]],[[safeZoneWAbs]],[[configFile]]<nowiki>]</nowiki> [[call]] [[BIS_fnc_parseNumberSafe]];{{cc|Returns [-0.452381,1.90476,0]}}</code>|Example 1=
|x1= <code><nowiki>[</nowiki>[[safeZoneX]],[[safeZoneWAbs]],[[configFile]]<nowiki>]</nowiki> [[call]] [[BIS_fnc_parseNumberSafe]];{{cc|Returns [-0.452381,1.90476,0]}}</code>
|x2= <code>["1337","2013",[[date]]] [[call]] [[BIS_fnc_parseNumberSafe]];{{cc|Returns [1337,2013,[2036,1,1,6,58]]}}</code>|Example 2=
|x2= <code>["1337","2013",[[date]]] [[call]] [[BIS_fnc_parseNumberSafe]];{{cc|Returns [1337,2013,[2036,1,1,6,58]]}}</code>
|x3= <code><nowiki>[</nowiki>[[west]],[[east]],[[independent]],[[civilian]]] [[call]] [[BIS_fnc_parseNumberSafe]];{{cc|Returns [1,0,2,3]}}</code>|Example 3=
|x3= <code><nowiki>[</nowiki>[[west]],[[east]],[[independent]],[[civilian]]] [[call]] [[BIS_fnc_parseNumberSafe]];{{cc|Returns [1,0,2,3]}}</code>


|exec= call |Execution=
|exec= call |Execution=

Revision as of 23:36, 17 January 2021

Hover & click on the images for description

Description

Description:
Converts expression into a number. Can also convert array of expressions into an array of numbers.
If expression does not return a number, 0 is returned.
Execution:
call
Groups:
Arrays

Syntax

Syntax:
[input] call BIS_fnc_parseNumberSafe
Parameters:
input: Number, String, Array, Side, Config or Array of those data types
Return Value:
Number or array of numbers if array is passed as an argument

Examples

Example 1:
[safeZoneX,safeZoneWAbs,configFile] call BIS_fnc_parseNumberSafe;// Returns [-0.452381,1.90476,0]
Example 2:
["1337","2013",date] call BIS_fnc_parseNumberSafe;// Returns [1337,2013,[2036,1,1,6,58]]
Example 3:
[west,east,independent,civilian] call BIS_fnc_parseNumberSafe;// Returns [1,0,2,3]

Additional Information

See also:
parseNumber BIS_fnc_parseNumber

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