Supress trailing zeros?

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.

round_filter.gh (12.3 KB)

3 Likes

2 Likes

Unfortunately, in my case none of this solutions works.

Supress_trailing_Zeros.gh (14.6 KB)

weird… try this more barbaric solution using Replace Text:

trailing_zeros2

2 Likes

This method seems to work. Thank you.

1 Like

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

5 Likes

Nice trick.

1 Like