Skip to content

Commit e09c20f

Browse files
committed
fix: incorrect converting 2-digit milliseconds to timestamp
previously milliseconds was taking as is and if it was 2 digit then app just adds e.g 24 ms instead of 240 to the timestamp.
1 parent ef9ba07 commit e09c20f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

chronograph/utils/parsers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ def timing_parser(string: str) -> int:
9393
try:
9494
pattern = r"(\d+):(\d+).(\d+)"
9595
mm, ss, ms = re.search(pattern, line_parser(string)).groups()
96+
if len(ms) == 2:
97+
ms = ms + "0"
9698
total_ss = int(mm) * 60 + int(ss)
9799
total_ms = total_ss * 1000 + int(ms)
98100
return total_ms

0 commit comments

Comments
 (0)