fix print float issue with precision > 10
This commit is contained in:
2 files changed
+2
-4
No files matched your search
@@ -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
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user