Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help with keepDecimalsOnWholeSeconds #43

Closed
AwesomeStickz opened this issue Dec 3, 2019 · 2 comments
Closed

Help with keepDecimalsOnWholeSeconds #43

AwesomeStickz opened this issue Dec 3, 2019 · 2 comments

Comments

@AwesomeStickz
Copy link

I tried to do like this
prettyms(22200526, { keepDecimalsOnWholeSeconds: true })

From what I understood, it should actually return something like this 6h 10m 1s or 6h 10m but every time it returns 6h 10m 0.5s if that keepDecimalsOnWholeSeconds option shows milli seconds too, what option should I use to round it

@sindresorhus
Copy link
Owner

From the docs:

Keep milliseconds on whole seconds: 13s → 13.0s.
Useful when you are showing a number of seconds spent on an operation and don't want the width of the output to change when hitting a whole number.

It preserves the milliseconds part even when it's zero. It doesn't round anything.

I don't think what you're asking is currently possible.

@AwesomeStickz
Copy link
Author

Oh ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants