2021-05-23 04:26 AM
Hello
void MovingStep_Container::SetStep(uint16_t data)
{
Unicode::snprintf(MovingStepTextBuffer, 20, "%d", data);
MovingStepText.setWildcard(MovingStepTextBuffer);
MovingStepText.invalidate();
}
Unicode::snprintf(MovingStepTextBuffer, 20, "%d", data); works without problem/
But if I write
Unicode::snprintf(MovingStepTextBuffer, 20, "%.1f", 0.1);
I get text "%.1f";
2021-05-23 07:25 AM
Often, float support within printf is disabled by default in order to reduce code size. Look for a way to configure it within your build settings.
2021-05-23 09:47 AM
@TDK this isnt settings for touchgfx
TouchGFX have special func for float read Unicode | TouchGFX Documentation
snprintfFloat(UnicodeChardst, uint16_t dstSize, const char format, const float value)Variant of snprintfFloats() for exactly one float only.