# toFixed: so Ubuntu = no error - so Raspberry = error

**URL:** <https://discourse.nodered.org/t/tofixed-so-ubuntu-no-error-so-raspberry-error/95690>\
**Category:** General\
**Created:** [27 February 2025 09:26 UTC](https://discourse.nodered.org/t/tofixed-so-ubuntu-no-error-so-raspberry-error/95690 "2025-02-27T09:26:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Giamma](https://avatars.discourse-cdn.com/v4/letter/g/e47774/32.png) [@Giamma](https://discourse.nodered.org/u/Giamma)\
**Post date:** [27 February 2025 09:26 UTC](https://discourse.nodered.org/t/tofixed-so-ubuntu-no-error-so-raspberry-error/95690/1 "2025-02-27T09:26:57Z")

</div>

Hi,  
I have one pc with ubuntu to test my code  
and one Raspberry (so raspberry) for my home automation.

Why this simple function

```auto
const pay = Number(msg.payload.toFixed(1));

```

in Ubuntu is ok and in Raspeberry show this error ?

```auto
TypeError: msg.payload.toFixed is not a function

```

---

<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 February 2025 09:34 UTC](https://discourse.nodered.org/t/tofixed-so-ubuntu-no-error-so-raspberry-error/95690/2 "2025-02-27T09:34:27Z")

</div>

Because the payload is NOT a number on your PI flows.  
Simple to verify with a debug node BEFORE the function.

---

<div class="post-metadata">

**Author:** ![Giamma](https://avatars.discourse-cdn.com/v4/letter/g/e47774/32.png) [@Giamma](https://discourse.nodered.org/u/Giamma)\
**Post date:** [27 February 2025 09:42 UTC](https://discourse.nodered.org/t/tofixed-so-ubuntu-no-error-so-raspberry-error/95690/3 "2025-02-27T09:42:44Z")

</div>

It's a temperature value, I thought it was a numeric value, not string ....  
Thank you very much (and thanks for your patience) ....

---

<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:** [13 March 2025 10:12 UTC](https://discourse.nodered.org/t/tofixed-so-ubuntu-no-error-so-raspberry-error/95690/5 "2025-03-13T10:12:43Z")

</div>

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