News:

SMF - Just Installed!

Main Menu

Float display precision

Started by jvblade, June 26, 2025, 04:49:40 AM

Previous topic - Next topic

jvblade

I am using a display object on a machine and want to display a float value of an analog input value, however it is displaying the float value to several decimal places. I only want to display it to one or two decimal places. How can I do this?

EasyPLC_Master

In the Wind Turbine scene, you have an example.

If you display object is called panel1 and the float variable is vr, you can use this sentence:

panel1.Value(vr.ToString("0.#")) //Shows only one decimal

panel1.Value(vr.ToString("0.##")) //Shows two decimal places.

jvblade