From e3cd293f4e726673cde29325aa9b13cf62990a50 Mon Sep 17 00:00:00 2001 From: FanDjango <51046875+FanDjango@users.noreply.github.com> Date: Tue, 5 Jan 2021 06:57:58 +0100 Subject: [PATCH] Adjustable precision in M105 temperature report (#20602) Co-authored-by: Scott Lahteine --- Marlin/src/module/temperature.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 327f43dc03..3c10354d02 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -3007,8 +3007,9 @@ void Temperature::tick() { if (e >= 0) SERIAL_CHAR('0' + e); #endif SERIAL_CHAR(':'); - SERIAL_ECHO(c); - SERIAL_ECHOPAIR(" /" , t); + SERIAL_PRINT(c, _MIN(SERIAL_FLOAT_PRECISION, 2)); + SERIAL_ECHOPGM(" /"); + SERIAL_PRINT(t, _MIN(SERIAL_FLOAT_PRECISION, 2)); #if ENABLED(SHOW_TEMP_ADC_VALUES) SERIAL_ECHOPAIR(" (", r * RECIPROCAL(OVERSAMPLENR)); SERIAL_CHAR(')');