# Control Roundoff/ Decimal

**URL:** <https://forum.dynamobim.com/t/control-roundoff-decimal/105989>\
**Category:** Revit\
**Tags:** python, dynamo\
**Created:** [November 20, 2024, 1:12pm UTC](https://forum.dynamobim.com/t/control-roundoff-decimal/105989 "2024-11-20T13:12:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vijay.mekala](https://avatars.discourse-cdn.com/v4/letter/v/96bed5/32.png) [@vijay.mekala](https://forum.dynamobim.com/u/vijay.mekala)\
**Post date:** [November 20, 2024, 1:12pm UTC](https://forum.dynamobim.com/t/control-roundoff-decimal/105989/1 "2024-11-20T13:12:05Z")

</div>

Hello all,

I need some assistance with a situation in my code. After using `Math.round`, I noticed that the end result still displays decimals, and I want to ensure the output shows only one decimal place. Could you guide me on how to control this?

Thank you in advance for your support!

Best regards,  
Vijay

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/b/9bf83cb8b5ba1150d89370417ac456e5122c7b86.jpeg)

---

<div class="post-metadata">

**Author:** ![patrick\_podeyn](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/patrick_podeyn/32/86368_2.png) [@patrick\_podeyn](https://forum.dynamobim.com/u/patrick_podeyn)\
**Post date:** [November 20, 2024, 1:26pm UTC](https://forum.dynamobim.com/t/control-roundoff-decimal/105989/2 "2024-11-20T13:26:05Z")

</div>

Hi,

I typically use this node from spring nodes. Let’s me specify amount to round and converts it to a string.

**Hope this helps!**

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/a/babddd0aed174f2015191794439d9e6d1de1e5ac.png)

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [November 20, 2024, 2:41pm UTC](https://forum.dynamobim.com/t/control-roundoff-decimal/105989/3 "2024-11-20T14:41:28Z")

</div>

Just to clarify what’s going on, this is how doubles get converted to strings. The string always converts to 6 decimal places for a double since that’s how the value is stored. You either get 6 places with a double or 0 with an integer. Rounding only rounds the value, not the precision. You can always trim the string afterwards, but a custom node is better.

---

<div class="post-metadata">

**Author:** ![vijay.mekala](https://avatars.discourse-cdn.com/v4/letter/v/96bed5/32.png) [@vijay.mekala](https://forum.dynamobim.com/u/vijay.mekala)\
**Post date:** [November 21, 2024, 4:46am UTC](https://forum.dynamobim.com/t/control-roundoff-decimal/105989/4 "2024-11-21T04:46:13Z")

</div>

Hi,

It’s working perfectly. Thanks for the suggestion!

Best regards,  
Vijay

---

<div class="post-metadata">

**Author:** ![\_Vijay](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/_vijay/32/91307_2.png) [@\_Vijay](https://forum.dynamobim.com/u/_Vijay)\
**Post date:** [November 21, 2024, 5:17am UTC](https://forum.dynamobim.com/t/control-roundoff-decimal/105989/5 "2024-11-21T05:17:32Z")

</div>

Here from some OOTP nodes,

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/8/d8817526cf24162705db3e23eca7269e9e15a02c.png)
