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

Method parse_numbers

FluidNC/src/OLED.cpp:199–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197}
198
199void OLED::parse_numbers(std::string s, float* nums, uint8_t maxnums) {
200 size_t pos = 0;
201 size_t nextpos = -1;
202 size_t i = 0;
203 do {
204 if (i >= maxnums) {
205 return;
206 }
207 nextpos = s.find_first_of(",", pos);
208 auto num = s.substr(pos, nextpos - pos);
209 string_util::from_float(num, nums[i++]);
210 pos = nextpos + 1;
211 } while (nextpos != std::string::npos);
212}
213
214void OLED::parse_axes(std::string s, float* axes) {
215 size_t pos = 0;

Callers

nothing calls this directly

Calls 1

from_floatFunction · 0.85

Tested by

no test coverage detected