Bug: Wrong unit

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
perot
Posts: 145
Joined: Wed Aug 30, 2017 5:40 pm

Re: Bug: Wrong unit

Post by perot »

thomas-neemann wrote: Fri Dec 03, 2021 4:58 pm
perot wrote: Fri Dec 03, 2021 4:39 pm

what speaks against specifying the unit mm?
You can call it either lazyness or convenience. There is a reason for defaults.

Cheers Peter
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Bug: Wrong unit

Post by openBrain »

perot wrote: Fri Dec 03, 2021 5:03 pm
chrisb wrote: Fri Dec 03, 2021 4:54 pm
openBrain wrote: Fri Dec 03, 2021 4:51 pm Do you have same thing if you use ',' (comma) instead of '.' (period) in your numbers?
If I do it vice versa and enter "0.95" it becomes 95mm (not nm).
That does not make any sense either
It should. In German, period is officially the thousand separator, not the decimal one. ;)
User avatar
thomas-neemann
Veteran
Posts: 11801
Joined: Wed Jan 22, 2020 6:03 pm
Location: Osnabrück DE 🇩🇪
Contact:

Re: Bug: Wrong unit

Post by thomas-neemann »

perot wrote: Fri Dec 03, 2021 5:05 pm
You can call it either lazyness or convenience. There is a reason for defaults.
then, given the opportunity, one could also standardize the different inputs comma or point. or is that already done?
Gruß Dipl.-Ing. (FH) Thomas Neemann

https://www.youtube.com/@thomasneemann5 ... ry=freecad
perot
Posts: 145
Joined: Wed Aug 30, 2017 5:40 pm

Re: Bug: Wrong unit

Post by perot »

openBrain wrote: Fri Dec 03, 2021 5:04 pm
perot wrote: Fri Dec 03, 2021 4:56 pm My (suspected) bug is about FreeCAD assuming the wrong unit when accepting user input.
When you reopen the dialog to enter 0.095, did you pay attention to already present unit? Did you really delete it?
I do that always the same way. With the mouse I select the whole entry (including the unit), and type in the new number. After the first keystroke the field is completely empty with the exception of the particular digit created by that keystroke.

At another attempt, FreeCAD got delayed when closing the Fillet dialog box after clicking OK (probably some background activity). I observed that after clicking OK, the unit "µm" popped up behind the "0.095" that I typed in, before a fraction of a second later the whole dialog box disappears. The smoking gun.

Cheers Peter
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Bug: Wrong unit

Post by openBrain »

perot wrote: Fri Dec 03, 2021 5:18 pm At another attempt, FreeCAD got delayed when closing the Fillet dialog box after clicking OK (probably some background activity). I observed that after clicking OK, the unit "µm" popped up behind the "0.095" that I typed in, before a fraction of a second later the whole dialog box disappears. The smoking gun.
OK. I'll have look at the code within the coming days to see if something is wrong.
perot
Posts: 145
Joined: Wed Aug 30, 2017 5:40 pm

Re: Bug: Wrong unit

Post by perot »

thomas-neemann wrote: Fri Dec 03, 2021 5:09 pm
perot wrote: Fri Dec 03, 2021 5:05 pm
You can call it either lazyness or convenience. There is a reason for defaults.
then, given the opportunity, one could also standardize the different inputs comma or point. or is that already done?
Pleeeeeeeeeeaaaaaaassse NOT! It is a huge nuisance when some software (against locale) requires commas, other (again against locale) requires decimal points, and for instance in Libre Office I cannot import data from international sources and german sources at the same time. When I do engineering work I ALWAYS use decimal points, and a FreeCAD forcing me to use comma because of some stupid locale would be a thorough pain in the arse.

If I had any say in that I'd impose a worldwide ban on commas in numbers. ;)

If we're talking about changes, I'd rather have that weird behaviour fixed that leaving a number input field empty leads to FreeCAD assuming value 1, rather than 0. That's driven me crazy a few times.

Cheers Peter
perot
Posts: 145
Joined: Wed Aug 30, 2017 5:40 pm

Re: Bug: Wrong unit

Post by perot »

openBrain wrote: Fri Dec 03, 2021 5:07 pm
perot wrote: Fri Dec 03, 2021 5:03 pm
chrisb wrote: Fri Dec 03, 2021 4:54 pm
openBrain wrote: Fri Dec 03, 2021 4:51 pm Do you have same thing if you use ',' (comma) instead of '.' (period) in your numbers?
If I do it vice versa and enter "0.95" it becomes 95mm (not nm).
That does not make any sense either
It should. In German, period is officially the thousand separator, not the decimal one. ;)
No. Period in german numbers is the thousands separator, which requires (first) that the mantissa starts before the period (leading zeros do not start a mantissa), and (second) that a multiple of sets of three digits follow. Neither requirement is satisfied by "0.95", so FreeCAD really has no right to treat the period here as a thousands separator.

It would also be inconsistent, as in other cases FreeCAD obviously treats comma and decimal point identically. Due to this discussion I checked number entry in several places, I cannot find any difference.

Cheers Peter
User avatar
thomas-neemann
Veteran
Posts: 11801
Joined: Wed Jan 22, 2020 6:03 pm
Location: Osnabrück DE 🇩🇪
Contact:

Re: Bug: Wrong unit

Post by thomas-neemann »

perot wrote: Fri Dec 03, 2021 5:37 pm ...It is a huge nuisance when some software (against locale) requires commas, other (again against locale) requires decimal points,....

ALWAYS use decimal points, ..

I don't care whether it's a point or a comma, it should just be freecad widely uniform
Gruß Dipl.-Ing. (FH) Thomas Neemann

https://www.youtube.com/@thomasneemann5 ... ry=freecad
chrisb
Veteran
Posts: 53922
Joined: Tue Mar 17, 2015 9:14 am

Re: Bug: Wrong unit

Post by chrisb »

My guess is that this input field is smart and doesn't use the new global stuff. As soon as you enter a digit, it shows up immediately in the list above.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Bug: Wrong unit

Post by openBrain »

perot wrote: Fri Dec 03, 2021 4:39 pm I found a situation where FreeCAD chooses default units inconsistently.
JFYI, I can reproduce the bug.
More findings :
* Can be reproduce on any Quantity spin box
* No influence whether using '.' or ',' as decimal separator
* Following OP example, entering '0.09' correctly gives "90 µm" but entering '0.090' wrongly gives '90 nm'

Could you open a bug in the tracker as it may take some time to narrow down where the problem comes from ?
Post Reply