Grasshopper

algorithmic modeling for Rhino

Hi,

I have a list of numbers being output to a panel but they are large so they are viewed as E+... instead of the whole number. Is there a way to change the setting so that when I output the file into a .csv file they are in their actual number format?

example: 2.350600E+005 (scientific notation) would be viewed as 235060.0 instead.

Thanks!

Views: 17452

Attachments:

Replies to This Discussion

Use this formula in an expression component: format("{0}",x)
Connect the point list to the 'x' input and the expression component should return the list of points without scientific notation.
Thanks Vicente...

Do you know,
Is there a way to easily remove the '{' and '}' so that the outFile just has #,#,#?
use this formula then: format("{0},{1},{2}",x.x,x.y,x.z)
I've also been wondering about this for some time.

Thank you Vincente for sharing and thank you Elizabeth for asking
There are a lot of formatting tricks for numbers available through the Format() function.

Standard formatting tags

Custom formatting tags

--
David Rutten
david@mcneel.com
Seattle, WA
Thanks!

why this is not working now?

I used this format issue for a long time but it is not working now on the last grasshopper...

Its a bit out of context and out of date, but is it possible to find the pathmapper component operators listed and explained in a page like the links which you gave above?

Thanks

Grasshopper (like Rhino) only supports English numeric formatting by default. The confusion would be complete if we allowed variable notation like that.

If you must create Dutch floating point numbers for export or display purposes then I'm afraid you'll have to perform a string replace operation. And since you're swapping two characters, you'll need to perform a game of Three-card-Monty as well:

I could add a Culture input to the Format component, you could then specify a culture such as "nl-NL". Cultures are also used to modify the way strings are sorted so maybe the string sort component also needs a culture input.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

I added culture data to Grasshopper and now Sorting and Formatting can be made to use the rules of a specific culture/language:

--

David Rutten

david@mcneel.com

Poprad, Slovakia

How do you fix the number of decimal places in this sort of formating statement?
Fixed number of decimals:

Format("{0:0.00000}", x) //exactly 5 decimals...

Format("{0:0.00###}", x) //at least 2 decimals, but we allow for 3 more if they're non-trivial.

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

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service