Group Numbers as per number of decimal points

Hi Jeremy,

What I have shown there is just an example data output, being written in the panel not necessarily in order but what I am trying to display is to create a process wherein I could be able to group the numbers based on the no. of decimal places, regardless of how many levels of precision it will be. The intent is to group them as per panels on the left-hand side.

Cheers,

That seems to be a script and I don’t have it.

Hi Martin,

Thanks, for some reason, it didn’t place the other number in the correct group?
Is there a way to break the GH definition? having a GH definition per condition?
say, one for collecting the whole number and them one decimal place, etc.?

Thanks,
Joel

Yes, my definition posted above fails in this case because your example did not include integers and the split text cannot split anything so the following list item returns the integer.

Here’s a quick update:

decimals_group.gh (13.6 KB)

PS: if you need any more help, please post a file containing the relevant numbers and scripts.

@Joel_Ocampo
The “Round To Decimal Place” component can be replaced with this simple expression.

1 Like

Just having fun:

decimals.gh (11.2 KB)

Hahahaha yes this is for fun only :slight_smile:

Thank you very much guys, l will have a look if l could get the particular portion of the definition and send to you guys for further assistance, kind regards.

Hi Toni, what component is the middle item? thanks.

image

It’s the Expression component

Thank you Martin, kind regards.

1 Like

Hi Toni, I tried your formula above but it give me a different result? what is you expression? thanks

Please recheck your function… It should be “Round (x, y)”

Double click the component to change the text.

1 Like

image

Without the space after Round.

image

Your screenshots aren’t very helpful please post a Grasshopper file containing the relevant data.