Version 018 print precision

Hello All, I remember a few months ago I was so happy with 018 release because it added the ability to add decimals after the print command - It was easy to print .1; .01; or even .001

Was I dreaming? I have searched the forum, AND looked at the changes in 018 and didn't find this listed anywhere.....

Darn if I can remember how this was done - not even some samples of code I've done shows me anything. Was I just dreaming?

Thanks for any help.

Ken H>

See the last three examples listed below.


For floating point numbers, this parameter specifies the number of decimal places to use. For example:

?Serial.print(78, BYTE) gives "N" ?Serial.print(78, BIN) gives "1001110" ?Serial.print(78, OCT) gives "116" ?Serial.print(78, DEC) gives "78" ?Serial.print(78, HEX) gives "4E" ?Serial.println(1.23456, 0) gives "1" ?Serial.println(1.23456, 2) gives "1.23" ?Serial.println(1.23456, 4) gives "1.2346"

That's it!! Darn I couldn't remember - and I found that page, I just didn't pick up on it with all the serial.Print..... I am using lcd.Print.

lcd.print ("volts = "); lcd.print(volt, 2); to get "volts = 3.32"

Thanks for the help.

Ken H.