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