pretty-ms icon indicating copy to clipboard operation
pretty-ms copied to clipboard

Option to output sub-second as decimal seconds

Open ulken opened this issue 6 months ago • 1 comments

@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 https://github.com/sindresorhus/pretty-ms/issues/20#issuecomment-1825457807

ulken avatar Dec 19 '23 14:12 ulken