Ticket #4402 - scientific notation for displaying numbers

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
HoWil
Posts: 1191
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Ticket #4402 - scientific notation for displaying numbers

Postby HoWil » Tue Jun 30, 2020 6:56 pm

Dear all,

I ask for using the scientific notation for displaying numbers where it is necessary.
The reason is the following.
I often use FEM and among others have to edit solver settings in the range of 1e-5 to 1e-9. All of these settings are simply shown as 0.0.

I know that it is already possible to enter number in scientific notation. I ask for some additional switch in the preferences next to 'number of decimals called something like 'use scientific notation to display numbers where necessary?'

The formula editor can help here. One can insert 1e-9 and the following is shown in the Value-column in the Data-Tab: 0,00 (1e-6). But I have to use the formula editor first which means I have to add all necessary (pre-filled) values into the formula editor to see/recognize it in the Value-column.
Below you see an example where the entry for Linear Tolerance is 0,00000001 and is shown as "0,0" where 1e-8 would be nice. When I would like to change it without formula editor I would have to set the number of decimals to 8 making other dialogues hard to use because of many unnecessary zeros.
Under Steady State Tolerance you can see the value "0,00 with (1e-9)" using the formula editor.
Screenshot from 2020-06-30 20-45-29.png
Screenshot from 2020-06-30 20-45-29.png (187.37 KiB) Viewed 304 times
What do you think.
Last edited by Kunda1 on Wed Jul 08, 2020 12:08 pm, edited 1 time in total.
Reason: Added ticket number to thread title
HoWil
Posts: 1191
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: scientific notation for displaying numbers

Postby HoWil » Sun Jul 05, 2020 7:29 pm

wmayer wrote: ping
@Werner I am not 100 sure that this is the right place to ask .... but what do you think is the above rel. easily achievable? or is this something impossible?
wmayer
Site Admin
Posts: 16272
Joined: Thu Feb 19, 2009 10:32 am

Re: scientific notation for displaying numbers

Postby wmayer » Sun Jul 05, 2020 8:17 pm

It is not impossible. Look at the example code below:

Code: Select all

ui=Gui.UiLoader()
w=ui.createWidget("Gui::QuantitySpinBox")
q=App.Units.Quantity("0.02")
q.Format={'Precision': 5, 'NumberFormat': 'e', 'Denominator': 2}
w.setProperty("value", q)
w.show()
When setting the number format to scientific ("e") the text is shown accordingly. However, when using the spin button the displayed text switches back to normal notation. So, there is probably not much needed to make the QuantitySpinBox working as requested.

But nevertheless you should open a ticket for a feature request.
HoWil
Posts: 1191
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: scientific notation for displaying numbers

Postby HoWil » Wed Jul 08, 2020 10:59 am

issue #0004402 Done.
@Werner .. I did sssign it to you. Is this OK?