MCPcopy Create free account
hub / github.com/bdring/FluidNC / from_float

Function from_float

FluidNC/src/string_util.cpp:100–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98 }
99
100 bool from_float(std::string_view sv, float& value) {
101 // std::from_chars() does not work for float arguments on ESP32
102 std::string s(sv);
103 char* floatEnd;
104 const char* str = s.c_str();
105 value = strtof(str, &floatEnd);
106 if (floatEnd != (str + sv.length())) {
107 return false;
108 }
109
110 return true;
111 }
112
113 bool split(std::string_view& input, std::string_view& next, char delim) {
114 auto pos = input.find_first_of(delim);

Callers 10

parse_numbersMethod · 0.85
parse_axesMethod · 0.85
parse_status_reportMethod · 0.85
itemMethod · 0.85
intValueMethod · 0.85
uintValueMethod · 0.85
floatValueMethod · 0.85
speedEntryValueMethod · 0.85
floatArrayMethod · 0.85
TESTFunction · 0.85

Calls 2

c_strMethod · 0.80
lengthMethod · 0.80

Tested by 1

TESTFunction · 0.68