Skip to main content
ledi001
Associate III
March 6, 2021
Solved

How can i round the digits of a number?

  • March 6, 2021
  • 2 replies
  • 4612 views

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?

This topic has been closed for replies.
Best answer by ledi001

got it... :)

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

will round the value by 2 digits.

2 replies

Uwe Bonnes
Chief
March 6, 2021

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

ledi001
ledi001AuthorBest answer
Associate III
March 6, 2021

got it... :)

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

will round the value by 2 digits.