Grasshopper

algorithmic modeling for Rhino

Just quick question, probably a stupid one, but can't seem to find it...

Is there any way of converting a Number (float) into an Integer (cutting off the decimal part) without any rounding, only using GH components? The way in C# would work:

float a = 2.9;

int b = (int) a;   // b becomes 2, not 3

Thanks

Views: 491

Replies to This Discussion

Hi Jose Luis,

 

If you use the Round Component you get three options for the output

N = Normal Rounding 2.9 --> 3 but 2.4 --> 2

F = Floor Rounding 2.9 --> 2

C = Ceiling Rounding 2.9 --> 3

 

Oh yeah, didn't see that one. Thanks Danny!

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service