Convert a given temperature to another system based on given boiling and freezing points | Function to return temperature in the second thermometer ; Calculate the temperature ; Driver Code
function temp_convert ( F1 , B1 , F2 , B2 , T ) { var t2 ; t2 = F2 + ( B2 - F2 ) / ( B1 - F1 ) * ( T - F1 ) ; return t2 ; } var F1 = 0 , B1 = 100 ; var F2 = 32 , B2 = 212 ; var T = 37 ; var t2 ; document . write ( temp_convert ( F1 , B1 , F2 , B2 , T ) . toFixed ( 2 ) ) ;