algorithmic modeling for Rhino
I'm struggling with the syntax for the Format(s[,a,b,c...]) function. If I want to get a result, "Distance= 20 feet" I'm expecting that I would write Format("Distance = ?x? feet",x) with the appropriate delimiter where I've placed question marks and x being the input value to the function component. I can't figure out what the delimiter is. Have I made some fundamental error in the use of this function?
Thanks.
Chris
Tags:
String formatting follows (calls) the .Net string formatting functions. ( method, formatting overview or nice introduction ).
In your case, this should do:
Format("Distance = {0} feet", x)
If you had two inputs:
Format("Distance = {0} {1}", x, unit)
- Giulio
____________
giulio@mcneel.com
McNeel Europe, Barcelona
Thank you.
Chris
That is a neat solution
Or {0:0.##} to allow for two decimal placed to be included, but only if they're not zero. Or {0:0.00##} to always include two decimals, but allow four if they are non-zero.
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by