rounding number after calculating celsius?
Posted: Fri Sep 06, 2013 6:56 am
I would like to have my custom HMI show one of my temps as F and also as C...
I have the following :
and it displays many digits after the decimal point...
I have tried:
and
and they just don't work... not really sure what I am dealing with...
I have the following :
Code: Select all
var Temp3 = ultemps[ULTMP_TMP + 3]/10;
var Temp3c = (((Temp3 - 32)*5)/9);
.
.
ctx.fillText(Temp3 + "F " + Temp3c + "C", 200, 132);
I have tried:
Code: Select all
var Temp3 = ultemps[ULTMP_TMP + 3]/10;
var Temp3c = round(((Temp3 - 32)*5)/9);
Code: Select all
var Temp3 = ultemps[ULTMP_TMP + 3]/10;
var Temp3c = math.round(((Temp3 - 32)*5)/9);