Skip to content

Commit

Permalink
Round down (instead of up) to nearest second (#429)
Browse files Browse the repository at this point in the history
Round down (instead of up) to nearest second
  • Loading branch information
benwiley4000 authored Jun 27, 2019
2 parents 6466d6a + 08e16d7 commit f7c1ecb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/player/src/utils/convertToTime.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
function convertToTime(number) {
const hours = Math.floor(number / (60 * 60));
const mins = Math.floor(number / 60) - hours * 60;
const secs = (number % 60).toFixed();
const secs = Math.floor(number % 60);
let time = hours > 0 ? `${hours}:` : '';
time += `${mins < 10 && hours > 0 ? '0' : ''}${mins}:`;
time += `${secs < 10 ? '0' : ''}${secs}`;
Expand Down

0 comments on commit f7c1ecb

Please sign in to comment.