mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-22 21:23:07 +03:00
Merge pull request #242 from Makuna/esp8266
dtostrf fix for remainder leading zeros
This commit is contained in:
commit
221fbb548f
@ -188,10 +188,10 @@ char * dtostrf(double number, signed char width, unsigned char prec, char *s) {
|
|||||||
++out;
|
++out;
|
||||||
}
|
}
|
||||||
|
|
||||||
while(prec-- > 0) {
|
for (unsigned char decShift = prec; decShift > 0; decShift--) {
|
||||||
remainder *= 10.0;
|
remainder *= 10.0;
|
||||||
}
|
}
|
||||||
sprintf(out, "%d", (int) remainder);
|
sprintf(out, "%0*d", prec, (int)remainder);
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user