1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2024-12-29 16:07:40 +01:00

Make minutes show as percent of hour

This commit is contained in:
Cooper Ransom 2024-03-17 22:56:19 -04:00
parent 872c786fbd
commit c683105d1e

View file

@ -164,9 +164,10 @@ async function getTimeSinceProcessStart(): Promise<string> {
const hours = Math.floor(timeDifference / (1000 * 60 * 60));
const minutes = Math.floor((timeDifference % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((timeDifference % (1000 * 60)) / 1000);
const percentageOfHour = Math.ceil(minutes / 60);
if (hours > 0) {
return `${hours}:${minutes} hours`;
return `${hours}.${percentageOfHour} hours`;
}
if (minutes > 0) {
return `${minutes} minutes`;