Closed sj26 closed 6 years ago
Thanks for the great library!
We noticed that pluralisation on current master, is a bit odd when formatting partial values:
equal(moment.duration(1.25, "s").format("s [secs]"), "1 sec"); // passes equal(moment.duration(1.5, "s").format("s [secs]"), "2 secs"); // passes equal(moment.duration(1.75, "s").format("s [secs]"), "2 secs"); // fails - gets "2 sec" equal(moment.duration(2, "s").format("s [secs]"), "2 secs"); // passes
It seems the code floors the value when considering whether to singularise/pluralise the unit name, but it still outputs a rounded value for the actual unit value itself.
Thanks for the note. I'd noticed that issue myself over the weekend, too. I'll have it fixed in the next push.
Thanks for the great library!
We noticed that pluralisation on current master, is a bit odd when formatting partial values:
It seems the code floors the value when considering whether to singularise/pluralise the unit name, but it still outputs a rounded value for the actual unit value itself.