File tree Expand file tree Collapse file tree 2 files changed +2
-0
lines changed
Expand file tree Collapse file tree 2 files changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -130,6 +130,7 @@ public static function internalTimeToSrt($internal_time)
130130 $ negative = true ;
131131 $ internal_time = abs ($ internal_time );
132132 }
133+ $ internal_time = round ($ internal_time , 3 );
133134
134135 $ hours = floor ($ internal_time / 3600 );
135136 $ minutes = floor (((int )$ internal_time % 3600 ) / 60 );
Original file line number Diff line number Diff line change @@ -293,6 +293,7 @@ public function testConvertToSrtTime()
293293 $ this ->assertEquals ('00:00:00,001 ' , SrtConverter::internalTimeToSrt (0.001 ));
294294 $ this ->assertEquals ('00:00:00,010 ' , SrtConverter::internalTimeToSrt (0.01 ));
295295 $ this ->assertEquals ('00:00:00,100 ' , SrtConverter::internalTimeToSrt (0.1 ));
296+ $ this ->assertEquals ('00:00:01,000 ' , SrtConverter::internalTimeToSrt (0.9999 ));
296297 $ this ->assertEquals ('99:59:59,000 ' , SrtConverter::internalTimeToSrt (359999 ));
297298 $ this ->assertEquals ('100:00:00,000 ' , SrtConverter::internalTimeToSrt (360000 ));
298299 }
You can’t perform that action at this time.
0 commit comments