This commit is contained in:
Totoo 2024-04-20 14:26:54 +02:00 committed by GitHub
parent 03ca87b13e
commit e7359563c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);