So this is a bit screwy using this 16x2 LCD. I want to display the temperature in the following format (for example): 78.35 degrees.
I’m using a Dallas One Wire thingy - and I get good data using the serial monitor. For example, when I open the serial monitor, I get the following: 78.35. Perfect.
Using the 16x2 display, when I use the code: lcd.print(temperature), I get: 78
Now, I realize, that for the 16x2 display, I have to put my own “.” between the first two (or three) digits, followed by a lcd.print(“.”) and then the last two digits.
My question, is how do I get the just the last two digits from my variable “temperature”?
I envision the code to be something like this:
lcd.print("Temp is: "); lcd.print(temperature); lcd.print("."); lcd.print(temperature); // just need the last two digits of the variable here
and a little degree symbol would be nice too!