Fix minimal-printf floating point decimal output error

pull/14179/head
caodd 2021-01-20 20:54:34 +08:00
parent d6784c3ee6
commit 9a7b2a8647
1 changed files with 2 additions and 0 deletions

View File

@ -302,6 +302,8 @@ static void mbed_minimal_formatted_string_double(char *buffer, size_t length, in
precision *= 10;
}
value = (value - integer) * precision;
/* convert to positive number */
if (value < 0.0) {
value *= -1.0;