Skip to content

Commit

Permalink
hotfix: Fixed zero padding in lrc format
Browse files Browse the repository at this point in the history
  • Loading branch information
akashrchandran committed Feb 21, 2023
1 parent 5e51d97 commit b47506e
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,8 @@ function make_reponse($response, $format)

function formatMS($milliseconds)
{
if ($milliseconds == 0) {
return '00:00.00';
}
$seconds = floor($milliseconds / 1000);
$minutes = floor($seconds / 60);
$centi = $milliseconds % 1000;
$seconds = $seconds % 60;
$minutes = $minutes % 60;
$format = '%02u:%02u.%03u';
$time = sprintf($format, $minutes, $seconds, $centi);
return rtrim($time, '0');
$lrc_timetag = sprintf('%02d:%02d.%02d', ($milliseconds / 1000) / 60, ($milliseconds / 1000) % 60, ($milliseconds % 1000) / 10);
return $lrc_timetag;
}

?>

0 comments on commit b47506e

Please sign in to comment.