eez-open / studio

Cross-platform low-code GUI and automation
https://www.envox.eu/studio/studio-introduction/
GNU General Public License v3.0
479 stars 88 forks source link

String.format(): Discrepancy between display of result in edit vs run or debug modes #546

Open bentron2000 opened 1 day ago

bentron2000 commented 1 day ago

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:

  1. Create a label on any screen.
  2. Make the label an expression with String.format(".2f",1.1)
  3. In EDIT mode, observe the label correctly display as 1.10
  4. Switch to RUN or DEBUG mode, observe the label display as .2f

Expected behavior Expect the result to be 1.10 in both cases.

Desktop :

LVGL version

mvladic commented 1 day ago

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).