Description
What MCU/Processor/Board and compiler are you using?
KEIL5.39,STM32F407,LVGL8.4
What do you want to achieve?
lv_label_set_text_fmt(scr_ui->screen_num_disp_label_disp_v,“%05.3f”,(float)3.141);
03.141 is displayed.
What have you tried so far?
/Change the built in (v)snprintf functions/
#define LV_SPRINTF_CUSTOM 1
#if LV_SPRINTF_CUSTOM
#define LV_SPRINTF_INCLUDE <stdio.h>
#define lv_snprintf snprintf
#define lv_vsnprintf vsnprintf
#else /LV_SPRINTF_CUSTOM/
#define LV_SPRINTF_USE_FLOAT 1
#endif /LV_SPRINTF_CUSTOM/
Code to reproduce
lv_label_set_text_fmt(scr_ui->screen_num_disp_label_disp_v,"%05.3f",(float)3.141);
Screenshot and/or video
Currently, 3.141 is displayed.