# Maths problem with function node

**URL:** <https://discourse.nodered.org/t/maths-problem-with-function-node/37503>\
**Category:** General\
**Created:** [14 December 2020 20:42 UTC](https://discourse.nodered.org/t/maths-problem-with-function-node/37503 "2020-12-14T20:42:04Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [14 December 2020 20:51 UTC](https://discourse.nodered.org/t/maths-problem-with-function-node/37503/2 "2020-12-14T20:51:43Z")

</div>

Hi @rich_node

welcome to the forum.

You're hitting a side effect of how JavaScript represents numbers internally. This blog post provides a good explanation: [http://adripofjavascript.com/blog/drips/avoiding-problems-with-decimal-math-in-javascript.html](http://adripofjavascript.com/blog/drips/avoiding-problems-with-decimal-math-in-javascript.html)

For future reference, please have a read of this post that explains how to share code and flows in the forum: [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506)

---

_[View the full topic](https://discourse.nodered.org/t/maths-problem-with-function-node/37503)._
