javascript return float from function code example Example: javascript format float let x = 0.548 console.log(x.toFixed(2)); // 0.54