Module: js-whatever/js/duration-format

js-whatever/js/duration-format

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
Properties:
Name Type Argument Default Description
duration.day string <optional>
' day'
duration.days string <optional>
' days'
duration.short.hour string <optional>
' hour'
duration.short.hours string <optional>
' hours'
duration.short.minute string <optional>
' min'
duration.short.minutes string <optional>
' mins'
duration.short.seconds string <optional>
's'
duration.short.millisecs string <optional>
'ms'
Source:
Copyright 2013-2018 Micro Focus International plc. Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
Documentation generated by JSDoc 3.4.3 on Thu Jun 21st 18:04 2018 using the DocStrap template.