Closed TioNoob closed 9 years ago
Turns out that we already had this feature under a different name, and I totally forgot to document it.
humanizeDuration(1000000000000) // 31 years, 8 months, 1 week, 19 hours, 46 minutes, 40 seconds
humanizeDuration(1000000000000, { largest: 2 }) // 31 years, 8 month
Updated the README with this change. Thanks for reminding me to document it!
This functionality was implemented for when we don't know what numbers will come (they can be big or small numbers), but is needed to show just the "X" most significant numbers. It's recommended use together with "round".