Grasshopper

algorithmic modeling for Rhino

I want to round a number
i use the function and write the function

Round(x[,d])


How do I have to write it so it works????

Round(x[,0])  ???? there is no help or explanation in this expression function list.....

Please help !
thanks

Views: 6347

Replies to This Discussion

Hi Maurice,

the square brackets mean the second argument is optional.

So, use:

Round(x)

to round to whole numbers. Or use:

Round(x, 4)

to round to 4 decimal places.

--
David Rutten
david@mcneel.com
Poprad, Slovakia
Thanks David

Quick answer !!!

I appreciate

Maurice
Hi David,
so it's very obvious that "[]"means things inside it are optional.Thanks for this information.

But how to use "Substring(s,i[,L])"??I tried,and with no luck.I think I miss something very obvious/essential.

Sorry, there is a bug in SubString, if you specify the optional third parameter it will always crash. I just fixed it, but it will be a while until the next version comes out.

--
David Rutten
david@mcneel.com
Poprad, Slovakia
Nice!
Yes, this was broken for a while now, remember this thread:
http://www.grasshopper3d.com/forum/topics/appending-to-a-tree
I just thought the problem was at the bottom of the To-Do list :)
There's a To-Do tree now. I dumped the list when we switched to 0.6.
It's a bit more flexible but I do sometimes get lost in the branches.

--
David Rutten
david@mcneel.com
Poprad, Slovakia
You have to keep pruning the tree so it stays pleasantly bonsai size, otherwise it will grow into a mighty oak (which, in this horticultural analogy, would be a bad thing).
Hi David

I'm trying to do something similar but it's rounding the number up to the nearest 1000.

Do you know how to go about this?

Many thanks

Dave

Yup, three steps:

  1. Multiply your value by 0.001 (ie. one over thousand)
  2. Round this value.
  3. Use the Ceiling output of the Round component and multiply that number by 1000
Many thanks David. That's a great help

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service