Expression Formatting

Hello There:

I have a Label with it’s text property binding linked to an expression as follows:

"Thermocouple Temp: " + tag({view.params.TagPath} + “/Temperatures/Thermocouple1/EU”) + " " + tag({view.params.TagPath} + “/Temperatures/Thermocouple1/EU.EngUnit”)

This works fine and displays the text as, “Thermocouple Temp: 123.12345 DegC” for example.

However, i want to format the value returned to only two decimal places so it would display 123.12 instead.

Would anyone know how I can accomplish this? It’s difficult because my expression returns both text and numbers.

Thank you

"Thermocouple Temp: "
+ numberFormat(tag({view.params.TagPath} + "/Temperatures/Thermocouple1/EU"), '#,##0.00')
+ " " + tag({view.params.TagPath} + "/Temperatures/Thermocouple1/EU.EngUnit")
1 Like

Worked. Thank you for this.

1 Like