From bb4898ae882775c9afc438bb637f57aba1eed5e4 Mon Sep 17 00:00:00 2001 From: Star Brilliant Date: Tue, 17 Sep 2013 05:46:49 +0800 Subject: [PATCH] Use round instead of int in ConvertTimestamp --- convert.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/convert.py b/convert.py index c0b5b35..35ddc97 100755 --- a/convert.py +++ b/convert.py @@ -98,7 +98,7 @@ def ReadCommentsBilibili(f, fontsize): def ConvertTimestamp(timestamp): hour, minute = divmod(timestamp, 3600) minute, second = divmod(minute, 60) - centsecond = int(second*100.0) + centsecond = round(second*100.0) return '%d:%02d:%02d.%02d' % (int(hour), int(minute), int(second), centsecond)