Skip to content

Commit fb0d646

Browse files
authored
Merge pull request #14179 from caoddx/fix-minimal-printf
Fix minimal-printf floating point decimal output error
2 parents e6565a4 + 9a7b2a8 commit fb0d646

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

platform/source/minimal-printf/mbed_printf_implementation.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,8 @@ static void mbed_minimal_formatted_string_double(char *buffer, size_t length, in
302302
precision *= 10;
303303
}
304304

305+
value = (value - integer) * precision;
306+
305307
/* convert to positive number */
306308
if (value < 0.0) {
307309
value *= -1.0;

0 commit comments

Comments
 (0)