forked from Pavel/labygui
update cout
This commit is contained in:
parent
5b2e63ce7c
commit
0753d62e98
10
labygui.py
10
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
|
||||
|
|
Loading…
Reference in New Issue