4

I'd like to have an expression that would round to the nearest 0.05. Can QGIS do this?

For example, if the real number was 1.4378, the label would read "1.45".

Or, if the real number was 1.4238, the label would read "1.40".

3
  • 6
    Multiply by twenty, round to integer, then divide by 20.0.
    – Vince
    Commented Jun 13, 2023 at 13:10
  • 7
    This is Vince's answer but formatted as an expression: round("real_num" * 20, 0)/20 Commented Jun 13, 2023 at 13:13
  • 2
    Or just "number" // 0.05 * 0.05
    – Mayo
    Commented Aug 23, 2023 at 19:12

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.