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

Supplement the field calculator help for the % operator and the Floor function #52095

Open
pigreco opened this issue Mar 4, 2023 · 2 comments
Labels
Expressions Related to the QGIS expression engine or specific expression functions Feature Request

Comments

@pigreco
Copy link
Contributor

pigreco commented Mar 4, 2023

Feature description

Operator %:

In case the Dividend is smaller than the Divisor, the remainder is always equal to the Dividend: example 10 % 20 --> 10;

it would be nice and helpful to add it in the guide and also add an example.

Floor function

The Floor Function corresponds (?) to the // operator: example floor(2/26) = 2//26

also in this case it would be nice and useful to read it in the guide

Additional context

W QGIS and Field Calculator

@pigreco pigreco added Feature Request Expressions Related to the QGIS expression engine or specific expression functions labels Mar 4, 2023
@baswein
Copy link
Contributor

baswein commented Mar 5, 2023

I also have wanted the documentation to mention modulo because that is what I search for.
Although according to this stack exchange it seems it is not a true modulo operator because it takes the sign of the dividend not the divisor.
So, in addition to your proposal I would like to add text saying Similar to modulo so I can search for it. And examples -9 % 2 --> -1 and 9 % -2 --> 1

@baswein
Copy link
Contributor

baswein commented Mar 5, 2023

Is the Floor function suggestion a duplicate of #52094?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Expressions Related to the QGIS expression engine or specific expression functions Feature Request
Projects
None yet
Development

No branches or pull requests

2 participants