cancel
Showing results for 
Search instead for 
Did you mean: 

How can i round the digits of a number?

ledi001
Associate III

Hi,

i am new with node-red functionality and i want to decrease the digits in a Gauge.

When i start the Dashboard i get the temperature in e.g. 21.77615442345 degrees. And i want to show it with 2 digits e.g. 21.78 degrees.

Ho can i do this?

1 ACCEPTED SOLUTION

Accepted Solutions
ledi001
Associate III

got it... :)

in the Gauge-node (Value format) type in {{value | number:2}}

will round the value by 2 digits.

View solution in original post

2 REPLIES 2
Uwe Bonnes
Principal III

What produces the printout. Maybe some format string like %6.3f will help.

ledi001
Associate III

got it... :)

in the Gauge-node (Value format) type in {{value | number:2}}

will round the value by 2 digits.