# How to decrease digits in a Gauge?

**URL:** <https://discourse.nodered.org/t/how-to-decrease-digits-in-a-gauge/42150>\
**Category:** Dashboard\
**Created:** [6 March 2021 13:13 UTC](https://discourse.nodered.org/t/how-to-decrease-digits-in-a-gauge/42150 "2021-03-06T13:13:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Heimo001](https://avatars.discourse-cdn.com/v4/letter/h/6a8cbe/32.png) [@Heimo001](https://discourse.nodered.org/u/Heimo001)\
**Post date:** [6 March 2021 13:13 UTC](https://discourse.nodered.org/t/how-to-decrease-digits-in-a-gauge/42150/1 "2021-03-06T13:13:29Z")

</div>

Hi,  
i am new with node-red and i want 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? ![2021-03-06_14h09_05](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/9/99df22fad5e9087f8ad62746ec4182b9fe034d0a.png)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [6 March 2021 13:23 UTC](https://discourse.nodered.org/t/how-to-decrease-digits-in-a-gauge/42150/2 "2021-03-06T13:23:59Z")

</div>

Not sure it gauge supports angular formatting but you can achieve this with a change node and JSONata...

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/2/e2eb627316317de4a7883deeb4b86f9a2e0c9441.png)

JSONata: `$round(payload, 2)`

demo flow

```auto
[{"id":"1841b241.5604ae","type":"inject","z":"6117dd0.3b67e24","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"27.123456789","payloadType":"num","x":630,"y":160,"wires":[["1c0d3d6d.2edd53","db59ece1.09794"]]},{"id":"1c0d3d6d.2edd53","type":"change","z":"6117dd0.3b67e24","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$round(payload, 2)\t","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":820,"y":160,"wires":[["92f6ae1b.7b05"]]},{"id":"db59ece1.09794","type":"debug","z":"6117dd0.3b67e24","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":630,"y":200,"wires":[]},{"id":"92f6ae1b.7b05","type":"debug","z":"6117dd0.3b67e24","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":830,"y":200,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [6 March 2021 13:28 UTC](https://discourse.nodered.org/t/how-to-decrease-digits-in-a-gauge/42150/3 "2021-03-06T13:28:33Z")

</div>

> [@Steve-Mcl](#):
>
> Not sure it gauge supports angular formatting

Yes it does.

@Heimo001 if you look in the help pane for the node you will see  
For example : `{{value | number:1}}%` will round the value to one decimal place and append a % sign.  
So if you put `{{value | number:2}}` you will get two places. No need for an extra node.

---

<div class="post-metadata">

**Author:** ![Heimo001](https://avatars.discourse-cdn.com/v4/letter/h/6a8cbe/32.png) [@Heimo001](https://discourse.nodered.org/u/Heimo001)\
**Post date:** [6 March 2021 13:39 UTC](https://discourse.nodered.org/t/how-to-decrease-digits-in-a-gauge/42150/4 "2021-03-06T13:39:05Z")

</div>

In my case, i am using STM32CubeMonitor with node-red implementation.  
So i mean this works a bit different?

 ![2021-03-06_14h37_17](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/1/21291eab2cf2f4d2934900b1f3f405c3d71ff920.png)

---

<div class="post-metadata">

**Author:** ![Heimo001](https://avatars.discourse-cdn.com/v4/letter/h/6a8cbe/32.png) [@Heimo001](https://discourse.nodered.org/u/Heimo001)\
**Post date:** [6 March 2021 13:56 UTC](https://discourse.nodered.org/t/how-to-decrease-digits-in-a-gauge/42150/5 "2021-03-06T13:56:38Z")

</div>

got it... 🙂

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

will round the value by 2 digits.

 ![2021-03-06_14h54_04](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/f/bfbedc20b56fb8cf3fb3d329e51939ec09c31a16.png)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [20 March 2021 13:57 UTC](https://discourse.nodered.org/t/how-to-decrease-digits-in-a-gauge/42150/6 "2021-03-20T13:57:34Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
