require("js-whatever/js/duration-format")(ms, strings, precision) → {string}
Rounds a duration to the specified precision. The duration is represented in terms of the largest
possible interval (from days, hours, minutes, seconds, milliseconds)
Parameters:
| Name | Type | Argument | Default | Description |
|---|---|---|---|---|
ms |
number | The duration to format in milliseconds |
||
strings |
DurationFormatStrings | Formatting strings to use |
||
precision |
number |
<optional> |
1 | The number of digits to appear after the decimal point |
- Source:
Returns:
A number to the specified precision, followed by a string representing the time period
- Type
- string
- Source:
Type Definitions
-
DurationFormatStrings
-
Type:
- object
- Source:
Properties:
Name Type Argument Default Description duration.daystring <optional>
' day' duration.daysstring <optional>
' days' duration.short.hourstring <optional>
' hour' duration.short.hoursstring <optional>
' hours' duration.short.minutestring <optional>
' min' duration.short.minutesstring <optional>
' mins' duration.short.secondsstring <optional>
's' duration.short.millisecsstring <optional>
'ms'