diff --git a/labygui.py b/labygui.py index bda96c5..91fb1d7 100644 --- a/labygui.py +++ b/labygui.py @@ -135,7 +135,15 @@ def fix_angle(a): return a * 2 * asin(1) / pi def cout(x): - return len(str(round(abs(x)/1.,5))) + n, c = 5, 1 + x = round(abs(x) * 10**n) + if x: + c = max(n + 1 - len(str(x)), 0) + while n and not (x % 10): + x = x // 10 + n -= 1 + c += not n + return 1 + len(str(x)) + c def tourner(a): global state