Arieleg / mpv-copyTime

Copy the current time of the video to clipboard.
GNU General Public License v3.0
73 stars 23 forks source link

corrected issue with minute and hour values #14

Open ritvikRC opened 2 years ago

ritvikRC commented 2 years ago

The problem with previous code was that the hours and minutes are passed in as float to string.format. string.format with "%02d" on float values rounds the values UP OR DOWN to the closest integer instead of rounding them ONLY DOWN to the closest integer.

The result of the previous code was that if the seconds value was greater than 30, the minutes value would be incorrectly incremented by 1. Similarly, if the minute value was greater than 30, the hour value would be incorrectly incremented by 1.