Skip to content

Commit ed21ef0

Browse files
authored
update print.doc --
In case of floating-point and specify the number of decimal places, Serial.print() supports rounding. 0 to 4 then rounddown, 5 to 9 then round up. so the original text Serial.print(1.23456, 4) gives "1.2345" should be: Serial.print(1.23456, 4) gives "1.2346" I checked the result on TINKERCAD and update line is correct.
1 parent 4ca291e commit ed21ef0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Language/Functions/Communication/Serial/print.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ An optional second parameter specifies the base (format) to use; permitted value
3030
* `_Serial_.print(78, HEX)` gives "4E" +
3131
* `_Serial_.print(1.23456, 0)` gives "1" +
3232
* `_Serial_.print(1.23456, 2)` gives "1.23" +
33-
* `_Serial_.print(1.23456, 4)` gives "1.2345"
33+
* `_Serial_.print(1.23456, 4)` gives "1.2346"
3434

3535
You can pass flash-memory based strings to `_Serial_.print()` by wrapping them with link:../../../../variables/utilities/progmem[F()]. For example:
3636

0 commit comments

Comments
 (0)