Open remisture opened 5 years ago
Have you managed to solve this? I'm in the same situation where I would expect S to be in line with moment 1.6.0+ where S, SS, SSS are tenths, hundredths, thousandths of a second respectively.
It's not totally what you want, but you can use the precision
option:
moment.duration(389.7, 'seconds').format("m:ss", 1);
"6:29.7"
moment.duration(389, 'seconds').format("m:ss", 1);
"6:29.0"
Your use case involves trimming the milliseconds when their value is 0. Which works, except not...
moment.duration(389, 'seconds').format("m:ss.S", { trim: "both" })
"6:29"
moment.duration(389.7, 'seconds').format("m:ss.S", { trim: "both" })
"6:29.700"