touchgfx::Unicode::snprintfFloats() method
@fn static UnicodeChar* Unicode::snprintfFloats(UnicodeChar* dst, uint16_t dstSize, const UnicodeChar* format, const float* values); Variant of snprintf for floats only. Variant of snprintf for floats only. The format supports several \%f with flags/modifiers. The following is supported: %[flags][width][.precision]f Where flags can be:
'-': left justify the field (see width).
'+': force sign.
' ': insert space if value is positive
'\#': insert decimal point even if there are not decimals
'0': left pad with zeros instead of spaces (see width)
Where width is the desired width of the output. If the value is larger, more characters may be generated, but not more than the parameter dstSize. If width is '*' the actual width is read from the list of values passed to this function. Where precision is the number of number of digits after the decimal point, default is 3. Use "%.f" to not generate any numbers after the decimal point. If precision is '*' the actual precision is read from the list of values passed to this function. \code{.cpp} float param1[3] = { 6.0f, 4.0f, 3.14159f }; Unicode::snprintfFloats(buffer, 20, "%*.*f", param1); // buffer="3.1416" float param2[2] = { 3.14159f, -123.4f }; Unicode::snprintfFloats(buffer, 20, "%f %f", param2); // buffer="3.142 -123.400" \endcode @see snprintf, snprintfFloat
Arguments
dst
dstSize
Size of the dst buffer measured by number of UnicodeChars the buffer can hold.
values
Return value
pointer to the first element in the buffer where the formatted string is placed.
Functions calling touchgfx::Unicode::snprintfFloats()
touchgfx::Unicode::snprintfFloats()
Type of touchgfx::Unicode::snprintfFloats()
touchgfx::Unicode::snprintfFloats()