Start a new topic

How to change variable to textbox with new format

I have a variable va0 from 000 to 999 

And a textbox t0 has MaxLenth = 4. I want to show format: "00.0" to "99.9" from va0.

Please help me how to do? Thank you so much!


Luong


The format is called floating point.

This has been covered several times.

look for float to text.


1 person likes this

I finding it, but i cannot found it.

I want to do it in Nextion only, without MCU.

Can you help me do it?

floating point has visible three parts

   integer              99

   decimal point      .

   fractional part     9

Break va0 into these parts and then combine into t0


1 person likes this

I use command : cov va0.val,t0.txt,2

And get interger 99 to t0

After I add '.' to t0. And it is Ok.

But the fractional part is 9 I can not get it and put to t0. Please help me!


This is HMI demo, please view it!

HMI
(36 KB)

Maybe I say it again


floating point has visible three parts

   integer              99

   decimal point      .

   fractional part     9

Break va0 into these parts ... and then combine ... into t0


Login or Signup to post a comment