sindresorhus/pretty-ms

Option to output sub-second as decimal seconds

ulken opened this issue · 1 comments

ulken commented

@sindresorhus Would you accept a PR that takes an option to keep the decimals on whole numbers? I'm using this library for a progress indicator thingy which keeps updating the time spent every ~60ms or so, and it keeps flickering in the terminal when it hits a whole number - I'd prefer if it just kept the fixed length as specified.

@sindresorhus For the same reason, I would find it preferable if sub-seconds could be output as seconds. I.e. 900ms -> 0.9s. Right now I'm wrapping pretty-ms and adding the logic myself, but does it qualify for an option to be included in the library?

Originally posted by @ulken in #20 (comment)

PR welcome :)