Number.toFixed() returns a string with the specified format.
What you would want to do is:
var tfixed = temp.toFixed(2); console.log("Temp: " + tfixed); return temp; //we probably want to return the number, not a string
or
console.log("Temp: " + temp.toFixed(2)); return temp;
@DrAzzy started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Number.toFixed() returns a string with the specified format.
What you would want to do is:
or