diff --git a/src/Spotify.php b/src/Spotify.php index 9aa8abd..c5f700b 100644 --- a/src/Spotify.php +++ b/src/Spotify.php @@ -120,8 +120,9 @@ function getLrcLyrics($lyrics): array * @return string The time in [mm:ss.xx] format. */ function formatMS($milliseconds): string - { - $lrc_timetag = sprintf('%02d:%02d.%02d', intval(($milliseconds / 1000) / 60), intval(($milliseconds / 1000) % 60), intval(($milliseconds % 1000) / 10)); + { + $th_secs = intdiv($milliseconds, 1000); + $lrc_timetag = sprintf('%02d:%02d.%02d', intdiv($th_secs , 60), $th_secs % 60, intdiv(($milliseconds % 1000), 10)); return $lrc_timetag; } }