js string template decimals

JavaScript
var num = 5.1234;
var n = num.toFixed(2); 
Source

Also in JavaScript: