Merge pull request #14179 from caoddx/fix-minimal-printf

Fix minimal-printf floating point decimal output error
pull/14239/head
Martin Kojtal 2021-02-05 10:10:39 +00:00 committed by GitHub
commit fb0d646f23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;