How can I achieve the following result (in column "output", string) in QGIS attribute table?

enter image description here

The values in "duration" were calculated with some other formulas and represent a certain time duration given in double data type. So 2.584 actually means 2 hours and 0.584 hours (=35 minutes).

Is there a way/expression to get the "output" column directly from the "duration" column in QGIS Field Calculator?

1 Answer 1


Try something like:

concat(to_string(floor(duration)),':',to_string(round((duration*60) % 60, 0)))
  • 2
    Please ask it as a new question. Do not forget to include an error that you got.
    – Taras
    Nov 8, 2020 at 20:15

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.