fix print float issue with precision > 10

This commit is contained in:
hathach committed 2019-01-11 15:24:48 +07:00
1 parent 1182aca25c
commit 417d11948f
2 files changed
+2 -4

No files matched your search

+1
View File
@@ -9,6 +9,7 @@
- Added Jlink as programmer to upload sketch #133
- Fixed issue with high speed uart baud ~ 1 Mbps (PR #158 thanks Ureloc)
- Add HardwardPWM removePin(), refactor hwpwm.ino sketch
- fix print float with precision > 10
## 0.9.2
+1 -4
View File
@@ -229,10 +229,7 @@ size_t Print::printFloat(double number, uint8_t digits)
char buf[256];
size_t s=0;
char format[] = "%.0f";
format[2] += digits;
s = snprintf(buf, 256, format, number);
s = snprintf(buf, 256, "%.*f", digits, number);
s = write(buf, s);
return s;
}