parseNumber: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (see also)
(note)
Line 27: Line 27:
<dl class="command_description">
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section BEGIN -->
 
<dd class="notedate">Posted on Aug 28, 2014
<dt class="note">[[User:ffur2007slx2_5|ffur2007slx2_5]]
<dd class="note"> (A3 1.26)It only detects the first occurrence of a number in the string, return 0 by default.
<code>[[parseNumber]] "2s4f"; // 2
[[parseNumber]] "s2f4"; // 0</code>
parse config or code, currently [[BIS_fnc_parseNumber]], occurrence is only limited with number, return -1 by default.
<code>{s3s4f} [[call]] [[BIS_fnc_parseNumber]]; // -1</code>
<!-- Note Section END -->
<!-- Note Section END -->
</dl>
</dl>

Revision as of 14:23, 28 August 2014

-wrong parameter ("Arma") defined!-1.00
Hover & click on the images for description

Description

Description:
Parse string containing real number.
Groups:
Uncategorised

Syntax

Syntax:
Number = parseNumber string
Parameters:
string: String
Return Value:
Number

Examples

Example 1:
_number = parseNumber "0.125";

Additional Information

See also:
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

Notes

Posted on Aug 28, 2014
ffur2007slx2_5
(A3 1.26)It only detects the first occurrence of a number in the string, return 0 by default. parseNumber "2s4f"; // 2 parseNumber "s2f4"; // 0 parse config or code, currently BIS_fnc_parseNumber, occurrence is only limited with number, return -1 by default. {s3s4f} call BIS_fnc_parseNumber; // -1

Bottom Section