sergeych / mp_stools

Collection of multiplatofrm string tools that does not exist on all platforms with the same interface: string and datetime formatting, etc. USeful fo write MP libraries and applications
MIT License
25 stars 0 forks source link

Support Duration formatting #5

Open LukasAnda opened 4 months ago

LukasAnda commented 4 months ago

Hey, thanks for the library, I recently found it and I think it is very useful. I am using it in my stopwatch application, which formats the time in HH:MM:SS format and I was thinking, why not directly support durations from Kotlin? I think, since there are already formatters for time, it should be quite a nice addition.

So for example this: "%tH:%tM:%tS".sprintf(2.hours + 3.minutes + 156.seconds) would produce 02:05:36 (due to seconds overflowing to minutes)

sergeych commented 4 months ago

thanks :) seems to be good idea, will add some duration support.