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

Expression editor in Layer Properties does not support division of integer data #19495

Closed
qgib opened this issue Sep 10, 2014 · 3 comments
Closed
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Expressions Related to the QGIS expression engine or specific expression functions High Priority
Milestone

Comments

@qgib
Copy link
Contributor

qgib commented Sep 10, 2014

Author Name: d d (d d)
Original Redmine Issue: 11182
Affected QGIS version: 2.4.0
Redmine category:expressions


Affected function: under Layer Properties --> Style --> Graduated --> Expression

Issue: writing an expression that divides values in two separate columns (type: int; length: 10) of an ESRI SHP file results in incorrect value (0). Addition, subtraction, and multiplication all work as expected and produce sensible results.

Expected behaviour: when dividing two integer values, the result should be promoted to a real value.

The Expression editor is non-functional in its present state.


Related issue(s): #14905 (duplicates)
Redmine related issue(s): 5153


@qgib
Copy link
Contributor Author

qgib commented Sep 10, 2014

Author Name: d d (d d)


  • fixed_version_id was changed from Future Release - High Priority to Version 2.6

@qgib
Copy link
Contributor Author

qgib commented Sep 10, 2014

Author Name: d d (d d)


It looks like this was discussed previously, but never resolved: #14905

@qgib
Copy link
Contributor Author

qgib commented Sep 10, 2014

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


d d wrote:

It looks like this was discussed previously, but never resolved: #14905

That's the intended behaviour. Division of integers produce integers. You can convert either argument using @to real(int)@ to produce a floating point result.


  • resolution was changed from to worksforme
  • status_id was changed from Open to Closed

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! High Priority Expressions Related to the QGIS expression engine or specific expression functions labels May 25, 2019
@qgib qgib added this to the Version 2.6 milestone May 25, 2019
@qgib qgib closed this as completed May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Expressions Related to the QGIS expression engine or specific expression functions High Priority
Projects
None yet
Development

No branches or pull requests

1 participant