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

Does anyone know if there is a connection between the 'absolute tolerance' setting in 'Units' dialogue box in Rhino and the point that GH converts the number to scientific notation.

 

Thank you in advance for any information that might help me.

 

Stan

Nope, it's a constant defined inside Grasshopper. I'll put it into the settings xml file so you can change it, though I doubt I'll make a UI for it.

 

Starting from the next version, you'll be able to adjust the thresholds for scientific notation formatting in the grasshopper_kernel.xml file inside the Grasshopper Settings folder (accessible via the Grasshopper menu). If you do change this file, do so while Grasshopper is not running as the file gets overwritten on Rhino shutdown.

 

These are the values you can change:

 

<item name="Format:ScientificNotation_Lower" type_name="gh_double" type_code="6">0.001</item>    

 

<item name="Format:ScientificNotation_Upper" type_name="gh_double" type_code="6">10000</item>

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Hello David,

Thank you for the feed back. The ability to adjust the threshold will be a welcome addition, although changing constants in code is a bit scary.


In the meantime, can you think of an alternate method to avoid the undesirable scientific notation rounding challenge? 

 

Thank you for all your hard work.  GH is an amazing tool.  I am so happy it came along during my lifetime.  It allows me to get the edge on my competition.

 

Stan

Nope, at present the formatting is hard-coded, you can't change it. 

And relax, you're not changing 'code'. It's just xml. And you can always rip out the entire line to revert to default, or even delete the entire xml file.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

I did figure one way to work around the scientific notation issue.  I offer it here in case it might help someone in the future.  I was originally working on a coordinate system dictated by my client.  The project location was a very far distance from the 0,0,0.  Therefore, all my point coordinates were 7 or 8 digit numbers which was the reason the scientific notation kicked in.  As a work around, I moved my model closer to 0,0,0 and will translate to owner coordinates when needed.  Can it be that simple???? Yes it can... At least it was for me this time.

 

It never fails, I learn something every single day.

Hi David,

This XML fix works perfectly, thank you!

I encountered the limits of scientific notation for the first time in grasshopper as a result of trying to work with WGS84 decimal coordinates and GIS data.

Would you consider adding a UI control for the upper and lower limits? Perhaps within the right-click menu for the numbers components? Or does this cause problems elsewhere?

RSS

Translate

Search Grasshopper

Members

Photos

  • Add Photos
  • View All

© 2012   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service