Grasshopper

generative 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!

Tags: E+, notation, number, scientific, view

Views: 801

Attachments:

Reply to This

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!
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
Arhhhhh, it was the colon I was missing!

Thanks David.
very helpful

I am reading point coordinates from an excel file and using the data in GH.  In excel the format of the numbers are not in scientific notation.  When those numbers are represented in GH they are automatically transformed to scientific notation.  Consequently, some of the digits are not shown.  For example, 166466.9352 in excel becomes 1.6647e+5 in GH.  I am concerned that some rounding has taken place and the point will be in the wrong place.  Can anyone shed some light on whether the number actually got rounded when used in GH?  Is there a way to set the number of digits before rounding.  If it got rounded is there a way to ensure the proper number of digits are carried over to GH.

 

Thank you

Stan

I answered my own question.  Undesired rounding is occurring due to the automatic conversion to scientific notation.  

 

I drew a point with the actual coordinates and compared it to the point baked in GH (scientific notation).  The points were not in the same place.  This is a concerning discrepancy.  It seems if you put in the right coordinates, you should get the right point, not a rounded coordinate.

 

Any thoughts?

 

Stan

RSS

Translate

Search Grasshopper

Members

Photos

  • Add Photos
  • View All

© 2012   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service