# Remove the values after fraction

**URL:** <https://discourse.nodered.org/t/remove-the-values-after-fraction/15108>\
**Category:** General\
**Created:** [4 September 2019 13:32 UTC](https://discourse.nodered.org/t/remove-the-values-after-fraction/15108 "2019-09-04T13:32:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Taqi.haider](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Taqi.haider](https://discourse.nodered.org/u/Taqi.haider)\
**Post date:** [4 September 2019 13:32 UTC](https://discourse.nodered.org/t/remove-the-values-after-fraction/15108/1 "2019-09-04T13:32:44Z")

</div>

I have a Real value like this 230.23456789 . I want to remove the values after fraction.  
Then the result will be shown like this 230.2.  
How will i have do it.

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [4 September 2019 13:44 UTC](https://discourse.nodered.org/t/remove-the-values-after-fraction/15108/2 "2019-09-04T13:44:41Z")

</div>

Use **`toFixed()`** Javascript function in a function window

---

<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:** [4 September 2019 14:30 UTC](https://discourse.nodered.org/t/remove-the-values-after-fraction/15108/3 "2019-09-04T14:30:19Z")

</div>

Also, if you are sending it to one of the dashboard nodes then you can do it in the node definition.

---

<div class="post-metadata">

**Author:** ![Taqi.haider](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Taqi.haider](https://discourse.nodered.org/u/Taqi.haider)\
**Post date:** [4 September 2019 15:42 UTC](https://discourse.nodered.org/t/remove-the-values-after-fraction/15108/4 "2019-09-04T15:42:40Z")

</div>

Please send the complete code

---

<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:** [4 September 2019 15:48 UTC](https://discourse.nodered.org/t/remove-the-values-after-fraction/15108/5 "2019-09-04T15:48:32Z")

</div>

What complete code?  
If you mean using toFixed() then google for javascript toFixed to find how to use it.

---

<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:** [4 September 2019 15:53 UTC](https://discourse.nodered.org/t/remove-the-values-after-fraction/15108/6 "2019-09-04T15:53:48Z")

</div>

This tells you how to do it in a dashboard node, courtesy of Paul Reed.

> [@Problems using '.toFixed()'](https://discourse.nodered.org/t/problems-using-tofixed/4192/14):
>
> If for example, you are displaying the value in a dashboard text node, you can always use angular filters to format the number. Adding {{msg.payload | number:1}} mph to the text node value format box will format a msg.payload from 18.31158 to 18.3 mph
