From b9594e59f12ea532d2685ce82fe400e373f8525f Mon Sep 17 00:00:00 2001 From: HTotoo Date: Sat, 20 Apr 2024 13:14:07 +0200 Subject: [PATCH] Fix bug --- firmware/application/string_format.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/firmware/application/string_format.cpp b/firmware/application/string_format.cpp index 8a061cb1e..fefbc16fe 100644 --- a/firmware/application/string_format.cpp +++ b/firmware/application/string_format.cpp @@ -159,6 +159,7 @@ std::string to_string_decimal(float decimal, int8_t precision) { double fractional_part; std::string result; + if (precision > 9) precision = 9; // we will convert to uin32_t, and that is the max it can hold. fractional_part = modf(decimal, &integer_part) * pow(10, precision);