P_WIDTH is stored in EEProm correctly but when I want to use it
P_WIDTH1 = P_WIDTH/10;
P_WIDTH = 175
P_WIDTH1 = 17.00
it should be
P_WIDTH = 175
P_WIDTH1 = 17.50
It's obvious to the most casual of observers that I'm missing something...LOL
P_WIDTH is stored in EEProm correctly but when I want to use it
P_WIDTH1 = P_WIDTH/10;
P_WIDTH = 175
P_WIDTH1 = 17.00
it should be
P_WIDTH = 175
P_WIDTH1 = 17.50
It's obvious to the most casual of observers that I'm missing something...LOL
Sorry I should have posted that to begin with but yes
unsigned int P_WIDTH;
float P_WIDTH1;
So all I had to do was add the .0 LOL thanks a bunch
Indeed - what was happening is that you had an integer datatype divided by an integer datatype - so it uses integer math. It was only after doing that math that it was assigned to a float. By putting the .0 on the 10, since one of the operands is a float, it will do floating point math, and you won't lose the decimal.