We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0048ffd commit 9889a09Copy full SHA for 9889a09
cores/arduino/avr/dtostrf.c
@@ -59,7 +59,7 @@ char *dtostrf (double val, signed char width, unsigned char prec, char *sout) {
59
remainder *= decade;
60
dec_part = (int)remainder;
61
62
- sprintf(sout, "%ld.%ld", int_part, dec_part);
+ sprintf(sout, "%ld.%0*ld", int_part, prec, dec_part);
63
64
// Handle minimum field width of the output string
65
// width is signed value, negative for left adjustment.
0 commit comments