Grasshopper

algorithmic modeling for Rhino

Hi All,

Other than using format like below is there another way to convert a number to string within an expression component.

Format("{0}", x)

As need it as input for string length calculation like so, this is part of a larger expression mind.

Length(Format("{0}", x))

Thanks 

Matt

Views: 1881

Replies to This Discussion

What is wrong with Format?

Nothing wrong with it, just though I would ask in case there was something else which I could learn also. Always on the hunt to learn new clever/simpler ways to ride code/expressions.

There are other ways, but Format is the most flexible method available. It's definitely the one you want to use as you have full control over decimals, whether or not to include trailing zeroes, whether to use scientific notation, whether to have thousand separators, ...

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service