From e25fb42d2d9fc77ab643b82f8c8f78d049943275 Mon Sep 17 00:00:00 2001 From: j Date: Wed, 30 Aug 2017 16:10:35 +0200 Subject: [PATCH] rounding issues --- subtitles.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/subtitles.py b/subtitles.py index 8ce965f..b9d590b 100755 --- a/subtitles.py +++ b/subtitles.py @@ -180,10 +180,10 @@ def render_subtitles(item_json, output_json, output_srt, lang): def overlaps(src, other): - src_in = float('%0.3f' % src['in']) - src_out = float('%0.3f' % src['out']) - other_in = float('%0.3f' % other['in']) - other_out = float('%0.3f' % other['out']) + src_in = float('%0.2f' % src['in']) + src_out = float('%0.2f' % src['out']) + other_in = float('%0.2f' % other['in']) + other_out = float('%0.2f' % other['out']) points = [] if src_in != other_in or src_out != other_out: # src inside @@ -193,6 +193,7 @@ def overlaps(src, other): points += [other['out']] return points + if __name__ == '__main__': if os.path.exists('subtitles.json'): items = json.load(open('subtitles.json'))