From 21feff72647ed125687f02a2874e6bb67a4f4063 Mon Sep 17 00:00:00 2001 From: Pavel Date: Fri, 22 Oct 2021 21:33:44 +0200 Subject: [PATCH] increase number of decimal places in editor.py --- alrys/editor.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/alrys/editor.py b/alrys/editor.py index 56a7b0c..550e076 100644 --- a/alrys/editor.py +++ b/alrys/editor.py @@ -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)