I have come up with the following expression to convert 5.1234 to 5° 7`24to 5°7'24.24"
toint ($x) || '° ' || toint((($x) - toint ($x)) * 60) ||'`' || substr( (tostring(((($x) - toint ($x)) * 60) - toint((($x) - toint ($x)) * 60)) * 60),1,5) || '"'
toint($x) || '° ' || toint((($x) - toint ($x))*60) || '`' || substr((tostring(((($x) - toint($x))*60) - toint((($x) - toint($x))*60))*60), 1, 5) || '"'
Here’s the problem : for for some points such as 5.1234, it works. butBut for others, itit doesn’t. II suspect the problem is the integer conversion which round up the decimal figures instead of truncating it.
Is there any other option? thanks.