js fixed 2 decimals code example Example: javascript fixed decimal var num = 5.56789; var n = num.toFixed(2);