- Reference
- Script reference
- Strings and buffers
fstrval
Evaluate a string to a float value
Description#
Float:fstrval( const str[], index=0, limit=15 )
Evaluate the string, starting at the index position for a float value
Max limit characters will be evaluated, starting at the index position.
Parameters#
str | source string |
index | start position in str |
Return value#
Returns the value as a float
Example usage#
new s{20};
new Float:x;
strcopy(s, "Hello3.14");
x = fstrval(s, 5);
// x now equals 3.14NOTE: requires firmware 24020101 or newer.
Last updated Feb 5, 2024