Round float to the nearest Odd or Even number

grasshopper
unhandled

(Papsphilip) #1

Hello! i am trying to round float numbers to their nearest odd or even number. Any ideas? I suspect some scripting would be necessary?


#2

No scripting needed. I came up with this, but I’m sure there will be an easier/shorter way to do it.


180611 Round off odd-even.gh (14.1 KB)


(Papsphilip) #3

Thanks! nice solution btw, you should make it a custom component for easy access.


(David Rutten) #4

There’s also this: roundtoevenodd.gh (12.2 KB)


#5

I knew there was gonna be a simpler way, nice and simple!