Skip to content

Commit 9a7b2a8

Browse files
committed
Fix minimal-printf floating point decimal output error
1 parent d6784c3 commit 9a7b2a8

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)