node-webvtt icon indicating copy to clipboard operation
node-webvtt copied to clipboard

[Compiler] Rounding Error for long decimals

Open goatandsheep opened this issue 6 years ago • 3 comments

Because I didn't carry the rounding, numbers such as 1.99999996 will compile to 00:00:01.1 . This is extremely problematic.

goatandsheep avatar Apr 16 '19 02:04 goatandsheep

It's fixed pretty easily by changing compiler:145 from Math.round --> Math.floor. I'm just waiting on my PR to be approved

goatandsheep avatar Apr 17 '19 14:04 goatandsheep

Fixed in #22

osk avatar Apr 20 '19 18:04 osk

This error was re-introduced in #36

1.99999 will now compile to 00:00:01.1000 (which makes the VTT file invalid).

See here: https://jsfiddle.net/londonshliach/e0kpbgL3/

londonshliach avatar Oct 11 '23 07:10 londonshliach