Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

almandsky
Copy link

@almandsky almandsky commented Oct 20, 2019

As per #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"

@mahnunchik
Copy link

ping

* @return {String}
* @api private
*/

function fmtLong(ms) {
function fmtLong(ms, demical) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be decimal, right?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uhm yeah

@shwarcu
Copy link

shwarcu commented Jul 26, 2022

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

@XaaRii
Copy link

XaaRii commented Dec 1, 2024

Is there literally any chance of this being implemented? I use it for years now, works flawlessly but it's a bit of hassle to always remember and look for the correct fork every time. It shouldn't even have any breaking features, only adding a one new (and quite useful one imho).

@dimitropoulos
Copy link
Collaborator

@XaaRii what fork have you been using that has this?

@XaaRii
Copy link

XaaRii commented Jul 30, 2025

@XaaRii what fork have you been using that has this?

That's a good question...
I found some backup files (I'm on vacation atm) and guessing by the package.json file, I seem to be using a fork from repo zeit/ms (version 2.1.2). I could be mistaken though, it's a long time since I set that project up and didn't follow general good practices back then.

edit: okay, zeit/ms seems to be the official repository of ms, my bad. I have the files of it, the author of it just didn't change/update their package.json to point to their own repo... I can probably find it in a browser history or something, I'll try to look it up.

@XaaRii
Copy link

XaaRii commented Jul 30, 2025

okay, after consulting my browser history, it's very likely almandsky's fork with his PR - specifically the sc/decimal_place branch. Makes sense.

https://github.com/almandsky/ms/tree/sc/decimal_place

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

Successfully merging this pull request may close these issues.

10 participants