mirror of https://github.com/ghostfolio/ghostfolio
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
725 B
30 lines
725 B
"use strict";
|
|
exports.secondsToMinutes = secondsToMinutes;
|
|
var _index = require("./constants.cjs");
|
|
|
|
/**
|
|
* @name secondsToMinutes
|
|
* @category Conversion Helpers
|
|
* @summary Convert seconds to minutes.
|
|
*
|
|
* @description
|
|
* Convert a number of seconds to a full number of minutes.
|
|
*
|
|
* @param seconds - The number of seconds to be converted
|
|
*
|
|
* @returns The number of seconds converted in minutes
|
|
*
|
|
* @example
|
|
* // Convert 120 seconds into minutes
|
|
* const result = secondsToMinutes(120)
|
|
* //=> 2
|
|
*
|
|
* @example
|
|
* // It uses floor rounding:
|
|
* const result = secondsToMinutes(119)
|
|
* //=> 1
|
|
*/
|
|
function secondsToMinutes(seconds) {
|
|
const minutes = seconds / _index.secondsInMinute;
|
|
return Math.trunc(minutes);
|
|
}
|
|
|