Grasshopper

algorithmic modeling for Rhino

Hello, is there any possible way to  round a number to 1 digit
The rules are
 4-5-6 to  5 
 7-8-9-1-2-3 to 0

The following example shows my problem

3.2-->3
2.8 -->3
2.4-->2.5
2.6-->2.5

Thank you   

Views: 981

Replies to This Discussion

Put in an expression such as Round(x, 1) - but that only rounds to 1 decimal place, not to whole numbers. 

My gut tells me you'll need some simple python

Ok.. this is the best i can do. I think 3 and 7 also round to .5

That is dope. I need to start brushing up on my python - which is not a euphemism. 

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service