# First flow on all my RPIs

**URL:** <https://discourse.nodered.org/t/first-flow-on-all-my-rpis/88878>\
**Category:** Share Your Projects\
**Created:** [23 June 2024 12:31 UTC](https://discourse.nodered.org/t/first-flow-on-all-my-rpis/88878 "2024-06-23T12:31:10Z")\
**Posts on this page:** 1\
**Showing post:** 9

<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:** [31 July 2024 06:01 UTC](https://discourse.nodered.org/t/first-flow-on-all-my-rpis/88878/9 "2024-07-31T06:01:49Z")

</div>

Yes @juntiedt has explained, slightly differently, how to call such a function from a function node.

What I asked though was if there is a way to call it from a change node.  
(eg using the "global...." output type)

Perhaps I should explain why I ask.

There has been [some discussion](https://discourse.nodered.org/t/suffix-for-text-output/89879) around formatting numbers for Dashboard 2, equivalent to the mustache feature of Dashboard 1 `{{ payload | number:2 }} °C`

The ["approved" way to format like](https://dashboard.flowfuse.com/nodes/widgets/ui-text.html#adding-prefixes-suffixes) that is to use a (not ui\_) template node, but it cannot achieve the rounding to 2 places. The work-around is Jsonata in a change node.

You can define a function

```auto
context.global.formatnumber = function runtime_str(number, dp, prefix, suffix)
{
    return (prefix + number.toFixed(dp) + suffix);
}

```

and call it from a function node as

```auto
msg.payload = context.global.formatnumber(input, 2, "£ ", " million");

```

If this global function could be accessed from a change node, or even a template, it would permit the value formatting without Jsonata.

---

_[View the full topic](https://discourse.nodered.org/t/first-flow-on-all-my-rpis/88878)._
