parseNumber: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " *\| *PARAMETER[0-9]{1,3} *= * " to " ") |
Lou Montana (talk | contribs) m (Text replacement - "<dd class="notedate">Posted on ([^<>]+) " to "<dd class="notedate">Posted on $1</dd> ") |
||
Line 37: | Line 37: | ||
<!-- Note Section BEGIN --> | <!-- Note Section BEGIN --> | ||
<dd class="notedate">Posted on Aug 28, 2014 | <dd class="notedate">Posted on Aug 28, 2014</dd> | ||
<dt class="note">[[User:ffur2007slx2_5|ffur2007slx2_5]] | <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. | <dd class="note"> (A3 1.26)It only detects the first occurrence of a number in the string, return 0 by default. |
Revision as of 01:05, 30 January 2021
Description
- Description:
- Description needed
- Groups:
- Strings
Syntax
- Syntax:
- Syntax needed
- Parameters:
- string: String
- Return Value:
- Return value needed
Alternative Syntax
- Syntax:
- parseNumber boolean Template:Since
- Parameters:
- boolean: Boolean
- Return Value:
- Number - 0 if false, 1 if true
Examples
- Example 1:
_number = parseNumber "0.125"; // 0.125
- Example 2:
_number = parseNumber "0050"; // 50
- Example 3:
_number = parseNumber "2 abc"; // 2
- Example 4:
_number = parseNumber true; // 1
Additional Information
- See also:
- See also needed
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
- 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