Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e99f5fd

Browse files
authored
Merge pull request RFduino#28 from ShenggaoZhu/fix-printf
Fixed Print::printf("%f") with correct digits
2 parents 998f340 + 4f40706 commit e99f5fd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cores/arduino/Print.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,9 @@ size_t Print::printf(const char *format, ...)
346346
if (l < 1)
347347
l = -l;
348348
l %= 100;
349+
if(l < 10){
350+
n += print(0);
351+
}
349352
n += print(l);
350353
}
351354
}

0 commit comments

Comments
 (0)