-
Notifications
You must be signed in to change notification settings - Fork 94
strtof
title: String to Float description: published: true date: 2023-03-16T23:12:20.091Z tags: editor: markdown dateCreated: 2023-03-16T22:30:22.736Z
The strtof native AI script function is used to convert a string to a float. There are three different versions of this function available, depending on the desired output values.
(value: f)strtof(string: s) // strtof_s_f
(value: f, isfloat: f)strtof(string: s) // strtof_s_ff
(value: f, isfloat: f, isfull: f)strtof(string: s) // strtof_s_fff
- string (string): The string to convert.
The return values of the strtof function depend on which version of the function is used:
- value (float): The converted value of the string.
- value (float): The converted value of the string.
- isfloat (float): A boolean value indicating whether the input string contained a value (1) or not (0).
- value (float): The converted value of the string.
- isfloat (float): A boolean value indicating whether the input string contained a value (1) or not (0).
- isfull (float): A boolean value indicating whether the input string only contained the converted value (1) or not (0).
(val)strtof($str);
This example code calls the strtof function with a string variable $str
and returns the converted value as a float.
(val, isfloat)strtof($str);
This example code calls the strtof function with a string variable $str
and returns the converted value as a float, as well as a boolean indicating whether the input string contained a value.
(val, isfloat, isfull)strtof($str);
This example code calls the strtof function with a string variable $str
and returns the converted value as a float, as well as two booleans indicating whether the input string contained a value and whether it only contained the converted value.