Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

field calculator: if you choose 'double' as fieldtype, the precision is NOT set to >0 #19632

Closed
qgib opened this issue Oct 6, 2014 · 8 comments
Labels
Feature Request Feedback Waiting on the submitter for answers

Comments

@qgib
Copy link
Contributor

qgib commented Oct 6, 2014

Author Name: Richard Duivenvoorde (@rduivenvoorde)
Original Redmine Issue: 11338

Redmine category:unknown


After a question on IRC of somebody who ended up with area's of 0

Load the shp from test.zip (epsg:28992)
Make layer editable
Open Field Calculator
Tick 'create a new field' and fieldname 'area' and fieldtype double (but do not touch the precision which in my case is 0 then)
Now create the column with value $area

then the area looks ok
but after saving all numbers are/look integers....

REMARK: changed from bug to feature request.

After some testing it appeared that the precision in the dialog was on 0 (zero)
so the actual were doubles, but without precision (25.1233 became 25).

So feature request: IF the user chooses 'double' as fieldtype and the precision = zero,
then either let it know (because a double with zero precision is not a double) and warn the user,
OR set the precision on 5 or so

also it's not fully clear if the 'precision' includes the output fieldwidth or not,
from IRC: "i set the precision to 10, saves 8, i set to 11 saves with 9 precision"


@qgib
Copy link
Contributor Author

qgib commented Oct 6, 2014

Author Name: Matthias Kuhn (@m-kuhn)


Just to be sure I understand correct. This feature request is:

  • Change the default precision for double to 5 instead of 0
  • Write a hint that the precision does not only affect decimals

@qgib
Copy link
Contributor Author

qgib commented Oct 6, 2014

Author Name: Richard Duivenvoorde (@rduivenvoorde)


I think this is actually the same one as: #17777

@qgib
Copy link
Contributor Author

qgib commented Oct 6, 2014

Author Name: Richard Duivenvoorde (@rduivenvoorde)


@mkuhn: Change the default precision for double to 5 instead of 0

So the Output field width should change to sensible defaults when you change the type.

as you see in #17777 also it is a caveat when you do not look at the precision...

Now if you change from double to int, it sets the precision to 0, but the other way around it does NOT set it back or to an other sensible value for double.
Same with text, I would think that maybe 30 is more sensible width then 10?

@qgib
Copy link
Contributor Author

qgib commented Apr 30, 2017

Author Name: Giovanni Manghi (@gioman)


  • easy_fix was configured as 0

@qgib
Copy link
Contributor Author

qgib commented Sep 22, 2017

Author Name: Jürgen Fischer (@jef-n)


  • category_id was configured as Unknown

@alexbruy
Copy link
Contributor

Seems fixed in master, when I choose double type precision is set to 3.

@alexbruy alexbruy added the Feedback Waiting on the submitter for answers label Apr 22, 2020
@alexbruy
Copy link
Contributor

alexbruy commented May 1, 2020

See also #16581

@alexbruy
Copy link
Contributor

Already fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Feedback Waiting on the submitter for answers
Projects
None yet
Development

No branches or pull requests

2 participants