武装突袭 Wiki
Advertisement
  

点击图片可看到更多讯息

开始使用于

游戏:
Armed Assault
版本:
1.00

描述

描述:
An SQF equivalent of C++ atof function. Parses the string, interpreting its content as a floating point number.

The command first discards as many whitespace characters as necessary until the first non-whitespace character is found. Then, starting from this character, takes as many characters as possible that are valid following a syntax resembling that of floating point literals, and interprets them as a numerical value. The rest of the string after the last valid character is ignored and has no effect on the behavior of this command.

If the first sequence of non-whitespace characters in string does not form a valid floating-point number, or if no such sequence exists because either string is empty or contains only whitespace characters, no conversion is performed and the command returns 0.

基本句法

句法:
parseNumber string
参数:
string: String
返回值:
Number

替代句法

句法:
parseNumber boolean        (Since Arma 3 v1.49.131731)
参数:
boolean: Boolean
返回值:
Number - 0 if false, 1 if true

范例

范例1:
_number = parseNumber "0.125"; //0.125
范例2:
_number = parseNumber "2 abc"; //2
范例3:
_number = parseNumber true; //1

额外资讯

多人游戏:
-
也可以看看:
BIS_fnc_parseNumber

注意事项

此处撰写句法皆为可行用法. 可到官网[1]专页回报错误. 你可以使用讨论页面或是论坛来进行讨论.
新增注意事项 | 如何新增?

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


Advertisement