vercel / ms

Tiny millisecond conversion utility
https://npmjs.com/ms
MIT License
5.16k stars 265 forks source link

Support optional rounding #170

Open CasperEngl opened 3 years ago

CasperEngl commented 3 years ago

This PR enables rounding through the roundoption.

round defaults to true and current solutions will continue to behave the same.

When round is set to false, all rounding is disabled.

When round is set to a number, it is used as precision for toFixed.

CasperEngl commented 3 years ago

Fixes #124 and #142

CasperEngl commented 2 years ago

@leerob Is anyone going through PRs on this repo?

leerob commented 2 years ago

Yes, our current focus right now with ms is stability. We have a canary release that publishes ESM and converts to TypeScript: https://github.com/vercel/ms/releases

CasperEngl commented 2 years ago

All right. I'll see if I can change the target branch from master to canary 👍

leerob commented 2 years ago

Those changes have been merged into master (will be main soon), there's just a canary release to test it out first. Main point was we're targeting stability, so likely will be slower to add new features to ms. There are over 100M weekly downloads of ms, so we're extremely cautious about what we add.

Thumbs up on this PR could be a good way to indicate how many people would like to see this feature land 👍

CasperEngl commented 2 years ago

I see. Thank you.

CasperEngl commented 2 years ago

Current conflicts have been resolved. I've also fixed some issues, having to do with the package name and lock file, since I had been using this package myself, deployed to npm.