# Supress trailing zeros?

**URL:** <https://discourse.mcneel.com/t/supress-trailing-zeros/149277>\
**Category:** Grasshopper\
**Tags:** windows\
**Created:** [October 18, 2022, 6:56pm UTC](https://discourse.mcneel.com/t/supress-trailing-zeros/149277 "2022-10-18T18:56:18Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Macuso](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/macuso/32/528700_2.png) [@Macuso](https://discourse.mcneel.com/u/Macuso)\
**Post date:** [October 18, 2022, 6:56pm UTC](https://discourse.mcneel.com/t/supress-trailing-zeros/149277/1 "2022-10-18T18:56:18Z")

</div>

I do have a definition in which I do get a mixed list of integer numbers and numbers with .0. Something like:

5  
5.0  
7.0  
6  
6.9  
9

How I can remore only the zeros after point? I do need the 6.9 or whatewer decimal will be excepting the zeros.

---

<div class="post-metadata">

**Author:** ![martinsiegrist](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/martinsiegrist/32/498369_2.png) [@martinsiegrist](https://discourse.mcneel.com/u/martinsiegrist)\
**Post date:** [October 18, 2022, 7:25pm UTC](https://discourse.mcneel.com/t/supress-trailing-zeros/149277/2 "2022-10-18T19:25:54Z")

</div>

![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/8/7/5/875dadca567306032c2e9f6e0407630f29484ad2.png)

[round\_filter.gh](https://discourse.mcneel.com/uploads/short-url/scfvGGISdbeVleuZuiKfm3c54Xc.gh) (12.3 KB)

---

<div class="post-metadata">

**Author:** ![submillimetre](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/submillimetre/32/480628_2.png) [@submillimetre](https://discourse.mcneel.com/u/submillimetre)\
**Post date:** [October 18, 2022, 7:27pm UTC](https://discourse.mcneel.com/t/supress-trailing-zeros/149277/3 "2022-10-18T19:27:52Z")

</div>

![trailing_zeros](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/8/e/5/8e5cf0fb1db5434a14425c9c6a7b35cc3f4f1714.png)

---

<div class="post-metadata">

**Author:** ![Macuso](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/macuso/32/528700_2.png) [@Macuso](https://discourse.mcneel.com/u/Macuso)\
**Post date:** [October 18, 2022, 7:38pm UTC](https://discourse.mcneel.com/t/supress-trailing-zeros/149277/4 "2022-10-18T19:38:08Z")

</div>

Unfortunately, in my case none of this solutions works.

 ![Supress_trailing_Zeros](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/3/4/8/34820b858d6a84cacea0b2fde91bf07f6a607829.png)

[Supress\_trailing\_Zeros.gh](https://discourse.mcneel.com/uploads/short-url/z0FhWD8eQbEyN2A1MoB9uwIEMUI.gh) (14.6 KB)

---

<div class="post-metadata">

**Author:** ![submillimetre](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/submillimetre/32/480628_2.png) [@submillimetre](https://discourse.mcneel.com/u/submillimetre)\
**Post date:** [October 18, 2022, 7:47pm UTC](https://discourse.mcneel.com/t/supress-trailing-zeros/149277/5 "2022-10-18T19:47:33Z")

</div>

weird… try this more barbaric solution using **Replace Text** :

![trailing_zeros2](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/9/5/b/95bcc896b950fd064e050ee1f8e9e3605336bf53.png)

---

<div class="post-metadata">

**Author:** ![Macuso](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/macuso/32/528700_2.png) [@Macuso](https://discourse.mcneel.com/u/Macuso)\
**Post date:** [October 18, 2022, 7:53pm UTC](https://discourse.mcneel.com/t/supress-trailing-zeros/149277/6 "2022-10-18T19:53:53Z")

</div>

This method seems to work. Thank you.

---

<div class="post-metadata">

**Author:** ![martinsiegrist](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/martinsiegrist/32/498369_2.png) [@martinsiegrist](https://discourse.mcneel.com/u/martinsiegrist)\
**Post date:** [October 18, 2022, 8:04pm UTC](https://discourse.mcneel.com/t/supress-trailing-zeros/149277/7 "2022-10-18T20:04:04Z")

</div>

![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/1/a/b/1abe2a3a87c30e3c598cfd994028eaf9ffe8d90a.png)

Both mine and @submillimetre ‘Num’ solution work fine if you pass the data through a panel or text component

---

<div class="post-metadata">

**Author:** ![Macuso](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/macuso/32/528700_2.png) [@Macuso](https://discourse.mcneel.com/u/Macuso)\
**Post date:** [October 18, 2022, 8:07pm UTC](https://discourse.mcneel.com/t/supress-trailing-zeros/149277/8 "2022-10-18T20:07:25Z")

</div>

Nice trick.
