Working with postgres and I need to convert total minutes into the format of 1h 1m.
I'm doing this via the following code
replace(
(119 / 60 + (119 % 60) / 100.0)::text,
'.',
'h '
) + 'm'
which returns 1h 59000000000000000000m
119 is just an example amount of minutes I've added, but this would be set on a larger query that would do
(accumulated_minutes / 60 + (accumulated_minutes % 60) / 100.0)::text,
is there a way to convert this to text without adding the extra precision?