increase number of decimal places in editor.py

This commit is contained in:
Pavel 2021-10-22 21:33:44 +02:00
parent 33beb61e27
commit 21feff7264
1 changed files with 10 additions and 10 deletions

View File

@ -63,13 +63,13 @@ def write_steps(steps):
buffer += '%3d %d %d %d\n' % (steps[0], steps[1], steps[2], steps[3])
buffer += '\n'
buffer += 'start (x a y b):\n'
buffer += '%7.3f %2d %6.3f %2d\n' % (steps[4], steps[5], steps[6], steps[7])
buffer += '%8.4f %2d %7.4f %2d\n' % (steps[4], steps[5], steps[6], steps[7])
buffer += '\n'
buffer += 'steps (x a y b):\n'
size = len(steps)
for k in range(8, size - 3, 4):
x2, a, y2, b = steps[k:k + 4]
buffer += '%7.3f %2d %6.3f %2d\n' % (x2, a, y2, b)
buffer += '%8.4f %2d %7.4f %2d\n' % (x2, a, y2, b)
return buffer
def optimize():
@ -192,7 +192,7 @@ def append_step(event):
x, a = convert_coordinate(x)
y, b = convert_coordinate(y)
text.edit_separator()
text.insert('end', '%7.3f %2d %6.3f %2d\n' % (x, a, y, b))
text.insert('end', '%8.4f %2d %7.4f %2d\n' % (x, a, y, b))
def insert_step(event):
global text, cell_w, cell_h
@ -201,7 +201,7 @@ def insert_step(event):
x, a = convert_coordinate(x)
y, b = convert_coordinate(y)
text.edit_separator()
text.insert('insert linestart', '%7.3f %2d %6.3f %2d\n' % (x, a, y, b))
text.insert('insert linestart', '%8.4f %2d %7.4f %2d\n' % (x, a, y, b))
def select_all(event):
global text
@ -305,14 +305,14 @@ state (l t b d):
250 1 0 0
start (x a y b):
47.500 0 43.500 0
47.5000 0 43.5000 0
steps (x a y b):
49.500 0 43.500 0
34.500 0 34.500 0
28.500 0 34.500 0
25.500 0 40.500 0
17.500 0 38.500 0
49.5000 0 43.5000 0
34.5000 0 34.5000 0
28.5000 0 34.5000 0
25.5000 0 40.5000 0
17.5000 0 38.5000 0
'''
text.insert('end', buffer)