ya know this might not be the prettiest code i've ever written

but god damn every time i use this fuckin function it makes me dumbass happy because it just fuckin works after tons of patching little issues with it until it's seemingly perfect now

p.szy.io/fuvIwQ/python

takes a floating point number of hours and converts it to something nice like "3 hours 12 minutes" if short_format is True, and could be something like "3 hours 12 minutes 33 seconds" or something if short_format is False

Follow

Oh also this was originally written for thingworx where I don't have the luxury of such things as "external libraries"

Sign in to participate in the conversation
Mastodon for Tech Folks

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!