parseNumber: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(add. ArmA2 classification)
No edit summary
Line 28: Line 28:
<!-- Note Section BEGIN -->
<!-- Note Section BEGIN -->
* If the text does not represent a number ("abc" for example), parseNumber will return 0 (zero). It is therefore not possible to use parseNumber to determine if the string contains a valid number or not.
* If the text does not represent a number ("abc" for example), parseNumber will return 0 (zero). It is therefore not possible to use parseNumber to determine if the string contains a valid number or not.
Super useful, if you have a value being passed through an .sqf to another and it is a number, it will read it as a string.  Use parseNumber to make it a number again!
<!-- Note Section END -->
<!-- Note Section END -->
</dl>
</dl>

Revision as of 01:26, 8 November 2009

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

Notes

  • If the text does not represent a number ("abc" for example), parseNumber will return 0 (zero). It is therefore not possible to use parseNumber to determine if the string contains a valid number or not.
Super useful, if you have a value being passed through an .sqf to another and it is a number, it will read it as a string. Use parseNumber to make it a number again!

Bottom Section