diff options
author | Ajay Ramachandran <[email protected]> | 2021-05-16 18:43:54 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2021-05-16 18:43:54 -0400 |
commit | daa7a653c9f21f8e83d4043654985493a2705b6f (patch) | |
tree | c8f469c34e03096ed0c8308c2ef8a36714cc43c3 | |
parent | ddf3f7c6ff55ece51a67d97e616bb97f03648bee (diff) | |
parent | 606b2fbee32e604dd2faa6c01c485aa4876347ad (diff) | |
download | SponsorBlock-daa7a653c9f21f8e83d4043654985493a2705b6f.tar.gz SponsorBlock-daa7a653c9f21f8e83d4043654985493a2705b6f.zip |
Merge pull request #747 from wilkmaciej/fix_saved_time_rounding
fix wrong saved time rounding
-rw-r--r-- | src/popup.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/popup.ts b/src/popup.ts index d13af4a0..c37d3d90 100644 --- a/src/popup.ts +++ b/src/popup.ts @@ -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 } |