fix wrong saved time rounding

This commit is contained in:
Maciej Wilk 2021-05-14 20:18:02 +02:00
parent 257098fd96
commit 606b2fbee3
No known key found for this signature in database
GPG key ID: FD172D95D81CD17E

View file

@ -726,10 +726,11 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
* @param {float} seconds
* @returns {string}
*/
function getFormattedHours(minues) {
const hours = Math.floor(minues / 60);
return (hours > 0 ? hours + "h " : "") + (minues % 60).toFixed(1);
}
function getFormattedHours(minutes) {
minutes = Math.round(minutes * 10) / 10
const hours = Math.floor(minutes / 60);
return (hours > 0 ? hours + "h " : "") + (minutes % 60).toFixed(1);
}
//end of function
}