Skip to content

Commit

Permalink
Merge pull request #73 from ramiel/fix-decimal
Browse files Browse the repository at this point in the history
Remove decimals from ms
  • Loading branch information
gsantiago committed Aug 12, 2021
2 parents f288e8f + c919d14 commit 96b75a6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/formatTimestamp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ export function formatTimestamp(
const hours = date.getHours()
const minutes = date.getMinutes()
const seconds = date.getSeconds()
const ms = timestamp - (hours * 3600000 + minutes * 60000 + seconds * 1000)
const ms = Math.floor(
timestamp - (hours * 3600000 + minutes * 60000 + seconds * 1000)
)

return `${padLeft(hours)}:${padLeft(minutes)}:${padLeft(seconds)}${
options.format === 'WebVTT' ? '.' : ','
Expand Down

0 comments on commit 96b75a6

Please sign in to comment.