Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
htotoo committed Apr 21, 2024
1 parent 5324243 commit 4652b37
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions firmware/application/string_format.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 4652b37

Please sign in to comment.