javascript format variable into string code example Example: js string template decimals var num = 5.1234; var n = num.toFixed(2);