From fe95e6eaa28641a62ced345ffa83038b2d26f6d5 Mon Sep 17 00:00:00 2001 From: daxcay Date: Wed, 1 May 2024 23:26:05 +0530 Subject: [PATCH] Update JDCN_BatchCounterAdvance.py Rounding issue fixed! --- classes/JDCN_BatchCounterAdvance.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/classes/JDCN_BatchCounterAdvance.py b/classes/JDCN_BatchCounterAdvance.py index b3836c0..ceba379 100644 --- a/classes/JDCN_BatchCounterAdvance.py +++ b/classes/JDCN_BatchCounterAdvance.py @@ -1,3 +1,5 @@ +import math + class JDCN_BatchCounterAdvance: def __init__(self): @@ -27,7 +29,7 @@ class JDCN_BatchCounterAdvance: try: finalRange = Range + Overlap - totalLaps = round(Frames/Range) + totalLaps = math.ceil(Frames/Range) extra = Frames % Range extraLap = 0 @@ -59,7 +61,7 @@ class JDCN_BatchCounterAdvance: except ValueError as e: print(e) - return (Lap, Range, finalRange, Overlap, (totalLaps+extraLap)+1, Frames, SkipFrame, SkipFrameWithout ) + return (Lap, Range, finalRange, Overlap, (totalLaps+extraLap), Frames, SkipFrame, SkipFrameWithout ) N_CLASS_MAPPINGS = {