Grasshopper

algorithmic modeling for Rhino

Hi

I've got a bunch of numbers between 0 and 1 and i want to round them (without changing there orders) to 5 numbers which are 0, 0.25, 0.5 , 0.75 and 1

how could i do this?

for example:

round this list of numbers (0.2, 0.45, 0.33, 0 , 0.89, 1, 0.71)

to this: (0.25, 0.5, 0.25, 0, 1, 1, 0.75)

Views: 2018

Replies to This Discussion

Find Similar Member component?
Or use an expression: CInt(x * 4) / 4

..check this... I made recently for my project.

Attachments:

Another method :

Thanx to everybody...

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service