diff --git a/fantemp/terminal.hpp b/fantemp/terminal.hpp index 0a2e916..ab33938 100644 --- a/fantemp/terminal.hpp +++ b/fantemp/terminal.hpp @@ -284,7 +284,9 @@ class Terminal { const auto histogramSamples = Statistics::getHistogram(t); m_serial.template txNumber(t); m_serial << F(" C = "); - m_serial.template txNumber((histogramSamples * 100) / totalSamples); + const auto percent = + static_cast((2 * 100 * histogramSamples + totalSamples) / (2 * totalSamples)); + m_serial.template txNumber(percent); m_serial << F("%\t"); const auto normalizedSamples = static_cast(histogramSamples / normalizationFactor); for (uint8_t i = 0; i < normalizedSamples; ++i) {