Rounding In Javascript To 2 Decimal Places January 29, 2024 Post a Comment I have a dropdown list and it has values which are to 2 decimal places. Delivery:Solution 1: Don't use parseInt() (as it kills the decimals). Use parseFloat() then toFixed():var delivery = parseFloat($('#delivery').val()).toFixed(2); CopyNote: If you are interested in rounds with toFixed(), reference this question.Solution 2: How about var delivery = parseFloat($('#delivery').val()).toFixed(2); CopySolution 3: usevar delivery = parseFloat($('#delivery').val()).toFixed(2); Copy Share Post a Comment for "Rounding In Javascript To 2 Decimal Places"
Post a Comment for "Rounding In Javascript To 2 Decimal Places"