MCPcopy Create free account
hub / github.com/FastLED/FastLED / ftoa

Function ftoa

src/fl/stl/charconv.cpp.hpp:186–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184}
185
186void ftoa(float value, char *buffer, int precision) {
187 // Forward to printf_detail for now - implementation in str.cpp will be updated
188 // to use this function instead of duplicating the logic
189 fl::string result = fl::printf_detail::format_float(value, precision);
190 fl::size len = result.length();
191 if (len > 63) len = 63; // Leave room for null terminator
192 for (fl::size i = 0; i < len; ++i) {
193 buffer[i] = result[i];
194 }
195 buffer[len] = '\0';
196}
197
198// Parse functions - moved from StringFormatter
199float parseFloat(const char *str, fl::size len) {

Callers 2

format_floatFunction · 0.85

Calls 2

format_floatFunction · 0.70
lengthMethod · 0.45

Tested by

no test coverage detected