This post has been relevant but nowadays there is a native function for this intent included in the expression calculator.

Now, you can simply run `to_dms(5.1234, 'x', 2)`. A capture of the current doc can be seen below

[![enter image description here][1]][1]


  [1]: https://i.sstatic.net/5ONEi.png