Converts the given string into a float, returning true if successful.
Synopsis
Declared in <absl/strings/numbers.h>
[[nodiscard]]
bool
SimpleAtof(
std::string_view str,
float* out);
Description
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.
Return Value
true on success; otherwise false.
|
Note
|
The return value should not be discarded. |
Parameters
Name |
Description |
str |
The string to parse. |
out |
The location that receives the parsed value. |
Created with MrDocs