From 4116b5b1365fa017285597f48b693348c1263241 Mon Sep 17 00:00:00 2001 From: falkTX Date: Mon, 28 Jun 2021 21:29:31 +0100 Subject: [PATCH] Improve countDecimalPoints --- source/frontend/carla_shared.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/frontend/carla_shared.py b/source/frontend/carla_shared.py index e429b0977..cf92cc73a 100644 --- a/source/frontend/carla_shared.py +++ b/source/frontend/carla_shared.py @@ -596,8 +596,8 @@ def countDecimalPoints(step, stepSmall): return 2 count = 0 - value = fmod(abs(stepSmall), 1) - while 0.001 < value < 0.99 and count < 6: + value = fmod(abs(step), 1) + while 0.0001 < value < 0.999 and count < 6: value = fmod(value*10, 1) count += 1