Grasshopper

algorithmic modeling for Rhino

Hi...,

 

how to convert a floating point value to an integer value in Grasshopper?

 

Thanks,

 

Michael

Views: 5394

Replies to This Discussion

CInt(valueToConvert)... you can use this in the expression editor on a specific input node or a separate formula component.
You can also just plug any number into an Int component (Params/Primitive/Int) and grasshopper will round to the nearest whole number.
Watch out though, for tie-breaking (something .5) it takes the closest even number, rather than the more common rule of always rounding up
Hi Daniel and Damien,

that worked, and sorry for my simple question.

Regards,

Michael
I have used this feature to detect odd numbers in series.

X/2=A[as float] B=CInt(A)

If A>B Then X is odd number.
Hi Angel

What component are you putting your expression in to detect odd numbers from a series and what inputs and outputs have you set.

Thanks matt

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service