FastLED 3.9.15
Loading...
Searching...
No Matches

◆ ftoa()

void fl::ftoa ( float value,
char * buffer,
int precision = 2 )

Convert floating point number to string buffer.

Parameters
valueThe float value to convert
bufferOutput buffer (must be at least 64 bytes)
precisionNumber of decimal places (default: 2)

Definition at line 186 of file charconv.cpp.hpp.

186 {
187 // Forward to printf_detail for now - implementation in str.cpp will be updated
188 // to use this function instead of duplicating the logic
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}
fl::string format_float(float value, int precision) FL_NOEXCEPT
Definition stdio.h:282
constexpr int type_rank< T >::value
expected< T, E > result
Alias for expected (Rust-style naming)
Definition result.h:31

References fl::printf_detail::format_float(), and type_rank< T >::value.

Referenced by fl::basic_string::append(), fl::basic_string::append(), and fl::format_detail::format_float().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: