• 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;
    
About

Avatar for DrAzzy @DrAzzy started