update: more beautiful time interval formatting
This commit is contained in:
parent
1895d601d9
commit
559c63b434
@ -3,7 +3,7 @@ export const formatSeconds = (seconds: number) => {
|
|||||||
return `${(seconds).toFixed(1)}s`;
|
return `${(seconds).toFixed(1)}s`;
|
||||||
}
|
}
|
||||||
if (seconds < 3600) {
|
if (seconds < 3600) {
|
||||||
return `${Math.floor(seconds / 60)}m${seconds % 60}s`;
|
return `${Math.floor(seconds / 60)}m${(seconds % 60).toFixed(1)}s`;
|
||||||
}
|
}
|
||||||
return `${Math.floor(seconds / 3600)}h ${((seconds % 3600) / 60).toFixed(2)}m`;
|
return `${Math.floor(seconds / 3600)}h ${((seconds % 3600) / 60).toFixed(2)}m`;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user