# Gauge w/ fixed format display

**URL:** https://discourse.nodered.org/t/gauge-w-fixed-format-display/97813
**Category:** General
**Tags:** dashboard-2
**Created:** [27 June 2025 05:45 UTC](https://discourse.nodered.org/t/gauge-w-fixed-format-display/97813 "2025-06-27T05:45:13Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![duaw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/duaw/32/20970_2.png) [@duaw](https://discourse.nodered.org/u/duaw)
#### Post date: [27 June 2025 05:45 UTC](https://discourse.nodered.org/t/gauge-w-fixed-format-display/97813/1 "2025-06-27T05:45:13Z")

</div>

Hi!  
I can't find it:  
Gauge gets a number, like 19.234 , 19.29 or just 19. I want to display 19.2 , 19.3 19.0 . I can round but then 19.0 is rendered as 19.  
What's the simple trick I just do not see? This must be a common use case. This was different but easy in DB1.  
Cheers, Uwe

---

<div class="post-metadata">

### Author: ![joepavitt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/joepavitt/32/59722_2.png) [@joepavitt](https://discourse.nodered.org/u/joepavitt)
#### Post date: [27 June 2025 08:06 UTC](https://discourse.nodered.org/t/gauge-w-fixed-format-display/97813/2 "2025-06-27T08:06:03Z")

</div>

The method (currently) is to use a "Change" node before the Gauge to format the `msg.payload` as it's sent in.

Appreciate this is not the most friendly developer experience though. I'll get a PR added. @Steve-Mcl FYI - I'm going to set this up using the `TypedInput` approach you had on that huge PR that we've never got round to fixing.

---

<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: [27 June 2025 08:15 UTC](https://discourse.nodered.org/t/gauge-w-fixed-format-display/97813/3 "2025-06-27T08:15:31Z")

</div>

I started an experiment that changed the flawed approach to that PR.

It used the same syntax as DB1 (ala angular pipe & vue-2 filters) and did client side formatting e.g.: `format: "value | number : '1.2-2'"` or `"value.title | titleCase"`

But never got around to making anything more than a geeky demo of it.

The typed input would be the ideal but its a minefield. It becomes a 2 way (sometimes 3 way) struggle between the entered value, dynamic 'ui\_update's and other factors. However, your more intimate knowledge of the DB2 mechanics and vue might make this fly (I can certainly assist once a pattern is formed)

---

<div class="post-metadata">

### Author: ![joepavitt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/joepavitt/32/59722_2.png) [@joepavitt](https://discourse.nodered.org/u/joepavitt)
#### Post date: [27 June 2025 08:23 UTC](https://discourse.nodered.org/t/gauge-w-fixed-format-display/97813/4 "2025-06-27T08:23:12Z")

</div>

Can you document on [Supporting typedInputs and simplified dynamic property setup by Steve-Mcl · Pull Request #1237 · FlowFuse/node-red-dashboard · GitHub](https://github.com/FlowFuse/node-red-dashboard/pull/1237) why that got blocked and what the issues were, just so it's recorded please

---

<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: [27 June 2025 08:31 UTC](https://discourse.nodered.org/t/gauge-w-fixed-format-display/97813/5 "2025-06-27T08:31:14Z")

</div>

Almost 1 year ago 👞 🧠

I am certain I wrote up the thing that killed it. Will check slack and other places before attempting to parse it all back into the old grey matter and risk forgetting something important, like how to walk or program 😉

---

<div class="post-metadata">

### Author: ![joepavitt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/joepavitt/32/59722_2.png) [@joepavitt](https://discourse.nodered.org/u/joepavitt)
#### Post date: [27 June 2025 09:34 UTC](https://discourse.nodered.org/t/gauge-w-fixed-format-display/97813/6 "2025-06-27T09:34:37Z")

</div>

I've opened [UI Gauge - Add a TypedInput to support value formatting by joepavitt · Pull Request #1752 · FlowFuse/node-red-dashboard · GitHub](https://github.com/FlowFuse/node-red-dashboard/pull/1752) which will add this as a new feature

---

<div class="post-metadata">

### Author: ![duaw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/duaw/32/20970_2.png) [@duaw](https://discourse.nodered.org/u/duaw)
#### Post date: [27 June 2025 12:04 UTC](https://discourse.nodered.org/t/gauge-w-fixed-format-display/97813/7 "2025-06-27T12:04:14Z")

</div>

> The method (currently) is to use a "Change" node before the Gauge to format the `msg.payload` as it's sent in.

I don't get it. Documentation states

> Values for the gauges can be set by sending a numerical value in `msg.payload`. The gauge will then update to reflect this value.

Yes, I round 19.011 to 1 digit, but the number 19.0 is then still rendered as '19', not '19.0' .

As far as my limited knowledge takes me, I can not achive what I want.

What really, really strucks me is that nobody disliked that behaviour so far. Migrating from DB1 to DB two this popped up at once and I really missed DB1 `Value format` `{{value | number:1}}`.

I can not follow the technical discussion below but providing a format string to render a number provided in `msg.payload` should be easy, shouldn't it?

I use JSONata `$formatNumber(number, picture [, options])` elsewhere, but a String cannot be fed to a gauge ...

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [27 June 2025 12:55 UTC](https://discourse.nodered.org/t/gauge-w-fixed-format-display/97813/8 "2025-06-27T12:55:36Z")

</div>

> [@duaw](#):
>
> What really, really strucks me is that nobody disliked that behaviour so far.

There have been several discussions about this, eg [https://discourse.nodered.org/t/cloning-d1-nodes-with-value-format-was-easy-what-is-the-best-d2-approach/96638](https://discourse.nodered.org/t/cloning-d1-nodes-with-value-format-was-easy-what-is-the-best-d2-approach/96638)

> [@duaw](#):
>
> a String cannot be fed to a gauge

Are you sure? It seems to work for me.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/5/25d653c286b647af7d87e5c471055c7f104ade4b.png)  
Alas, there are plenty of other reasons to shun the ui-gauge!

---

<div class="post-metadata">

### Author: ![gerrybartley](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerrybartley/32/67495_2.png) [@gerrybartley](https://discourse.nodered.org/u/gerrybartley)
#### Post date: [27 June 2025 12:59 UTC](https://discourse.nodered.org/t/gauge-w-fixed-format-display/97813/9 "2025-06-27T12:59:05Z")

</div>

Strings def work with gauge

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

---

<div class="post-metadata">

### Author: ![joepavitt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/joepavitt/32/59722_2.png) [@joepavitt](https://discourse.nodered.org/u/joepavitt)
#### Post date: [27 June 2025 13:17 UTC](https://discourse.nodered.org/t/gauge-w-fixed-format-display/97813/10 "2025-06-27T13:17:45Z")

</div>

> [@duaw](#):
>
> As far as my limited knowledge takes me, I can not achieve what I want.

Once the PR I've linked has been reviewed, then we can do a release, and it'll be much easier. Possibly this afternoon, probably early next week.

---

<div class="post-metadata">

### Author: ![smanjunath211](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/smanjunath211/32/95742_2.png) [@smanjunath211](https://discourse.nodered.org/u/smanjunath211)
#### Post date: [27 June 2025 15:06 UTC](https://discourse.nodered.org/t/gauge-w-fixed-format-display/97813/11 "2025-06-27T15:06:04Z")

</div>

```auto
[{"id":"e8353a7ab039d70c","type":"change","z":"aca56a30ae9c5750","name":"Number Format","rules":[{"t":"set","p":"payload","pt":"msg","to":"$formatNumber(payload, \"#,#0.0\")\t","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":760,"wires":[["b9c06c3fc983e0e0"]]}]

```

![zero_in_gauge](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/6/068358bdc31371835fc975a885347a3ccec2b591.gif)

---

<div class="post-metadata">

### Author: ![duaw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/duaw/32/20970_2.png) [@duaw](https://discourse.nodered.org/u/duaw)
#### Post date: [27 June 2025 15:38 UTC](https://discourse.nodered.org/t/gauge-w-fixed-format-display/97813/12 "2025-06-27T15:38:51Z")

</div>

My apologies ... I think I tried, now I tried again, et voilà. Strings can be sent to a gauge.

---

<div class="post-metadata">

### Author: ![joepavitt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/joepavitt/32/59722_2.png) [@joepavitt](https://discourse.nodered.org/u/joepavitt)
#### Post date: [4 July 2025 14:13 UTC](https://discourse.nodered.org/t/gauge-w-fixed-format-display/97813/13 "2025-07-04T14:13:38Z")

</div>

This is all now supported with the `1.25.0` release of FlowFuse Dashboard: [Gauge ui-gauge | Node-RED Dashboard 2.0](https://dashboard.flowfuse.com/nodes/widgets/ui-gauge#formatting-value)

---

<div class="post-metadata">

### Author: ![duaw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/duaw/32/20970_2.png) [@duaw](https://discourse.nodered.org/u/duaw)
#### Post date: [5 July 2025 08:13 UTC](https://discourse.nodered.org/t/gauge-w-fixed-format-display/97813/14 "2025-07-05T08:13:23Z")

</div>

Brilliant. Thank you!

---

<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: [19 July 2025 08:13 UTC](https://discourse.nodered.org/t/gauge-w-fixed-format-display/97813/15 "2025-07-19T08:13:57Z")

</div>

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