mirror of
https://github.com/sussy-code/smov.git
synced 2025-01-01 16:37:39 +01:00
Make minutes show as percent of hour
This commit is contained in:
parent
872c786fbd
commit
c683105d1e
1 changed files with 2 additions and 1 deletions
|
@ -164,9 +164,10 @@ async function getTimeSinceProcessStart(): Promise<string> {
|
||||||
const hours = Math.floor(timeDifference / (1000 * 60 * 60));
|
const hours = Math.floor(timeDifference / (1000 * 60 * 60));
|
||||||
const minutes = Math.floor((timeDifference % (1000 * 60 * 60)) / (1000 * 60));
|
const minutes = Math.floor((timeDifference % (1000 * 60 * 60)) / (1000 * 60));
|
||||||
const seconds = Math.floor((timeDifference % (1000 * 60)) / 1000);
|
const seconds = Math.floor((timeDifference % (1000 * 60)) / 1000);
|
||||||
|
const percentageOfHour = Math.ceil(minutes / 60);
|
||||||
|
|
||||||
if (hours > 0) {
|
if (hours > 0) {
|
||||||
return `${hours}:${minutes} hours`;
|
return `${hours}.${percentageOfHour} hours`;
|
||||||
}
|
}
|
||||||
if (minutes > 0) {
|
if (minutes > 0) {
|
||||||
return `${minutes} minutes`;
|
return `${minutes} minutes`;
|
||||||
|
|
Loading…
Reference in a new issue