ms icon indicating copy to clipboard operation
ms copied to clipboard

Add decimal place support

Open almandsky opened this issue 5 years ago • 2 comments

As per https://github.com/zeit/ms/issues/124

Here is the PR to add decimal place support. Default is 0, max decimal place is 3.

ms(60000, { decimal: 1 })                           // "1m"
ms(66000, { decimal: 1 })                           // "1.1m"
ms(-3 * 66000, { long: true, decimal: 1 })          // "-3.3 minutes"
ms(234234234, { decimal: 2  })                      // "2.71m"
ms(ms('10.5 hours'), { long: true, decimal: 1 })    // "10.5 hours"

almandsky avatar Oct 20 '19 08:10 almandsky

ping

mahnunchik avatar Apr 02 '21 13:04 mahnunchik

@leerob @gmattie any chance for having this functionality added?

shwarcu avatar Jul 26 '22 11:07 shwarcu