Converts the given string into a float, returning true if successful.
Declared in <absl/strings/numbers.h>
[[nodiscard]]
bool
SimpleAtof(
std::string_view str,
float* out);
The string (optionally followed or preceded by ASCII whitespace) may be rounded on overflow or underflow. See https://en.cppreference.com/w/c/string/byte/strtof for details about the allowed formats for str, except SimpleAtof() is locale-independent and will always use the "C" locale. If any errors are encountered, this function returns false, leaving out in an unspecified state.
| Name | Description |
|---|---|
| str | The string to parse. |
| out | The location that receives the parsed value. |