From 72898360f3ccdc99eafbfc15366bc82cd5fcaca1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 9 May 2017 09:38:10 +0200 Subject: [PATCH] Get rid of ridiculous float precision in temperature commands "M104 S200.00000000" is completely unnecessary when "M104 S200" works just fine. --- src/octoprint/printer/standard.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/octoprint/printer/standard.py b/src/octoprint/printer/standard.py index b22c3cc5..7c3ba32e 100644 --- a/src/octoprint/printer/standard.py +++ b/src/octoprint/printer/standard.py @@ -334,12 +334,12 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback): shared_nozzle = printer_profile["extruder"]["sharedNozzle"] if extruder_count > 1 and not shared_nozzle: toolNum = int(heater[len("tool"):]) - self.commands("M104 T%d S%f" % (toolNum, value)) + self.commands("M104 T{} S{}".format(toolNum, value)) else: - self.commands("M104 S%f" % value) + self.commands("M104 S{}".format(value)) elif heater == "bed": - self.commands("M140 S%f" % value) + self.commands("M140 S{}".format(value)) def set_temperature_offset(self, offsets=None): if offsets is None: @@ -370,7 +370,7 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback): factor = int(factor * 100.0) if factor < min or factor > max: - raise ValueError("factor must be a value between %f and %f" % (min, max)) + raise ValueError("factor must be a value between {} and {}".format(min, max)) return factor