cancel
Showing results for 
Search instead for 
Did you mean: 

How to add % to a text widget

JPabl.1
Senior

Hi there TouchGFX team. 

 

I need to print a percentage value on a text widget. The progress bar doesn't fit me, I just need the value to be displayed. 

This is done in the widget configuration or is done in code by the dev concatenating the "value" + "%" ?

Thanks a lot in advance

1 REPLY 1
GaetanGodart
ST Employee

Hello @JPabl.1 ,

 

To display something like "15%" or "2%", you can simply add a wildcard to your textArea followed by the % sign :

GaetanGodart_1-1734353229636.png

Make sure to add "0-9" in the wildcard range of the typography used for the textArea :

GaetanGodart_0-1734353204691.png
Then you can change the value of the wildcard in code.

 

Please find attached an example of this.

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)