studio
studio copied to clipboard
String.format(): Discrepancy between display of result in edit vs run or debug modes
Have noticed a bug in version 0.16.1 in the implementation of String.format() Discrepancy between display of result in edit vs run or debug modes.
To Reproduce:
- Create a label on any screen.
- Make the label an expression with
String.format(".2f",1.1) - In
EDITmode, observe the label correctly display as1.10 - Switch to
RUNorDEBUGmode, observe the label display as.2f
Expected behavior
Expect the result to be 1.10 in both cases.
Desktop :
- MacOS 14.4
- Version 0.16.1
** LVGL version**
- 9.x
Format specification for the String.format function when used in LVGL project must use % prefix. So, your expression should be String.format("%.2f",1.1).