javascript convert string to decimal 2 places code example
Example 1: javascript convert string to 2 decimal
var twoPlacedFloat = parseFloat(yourString).toFixed(2)
Example 2: to 2 decimal places javascript
var discount = Math.round((100 - (price / listprice) * 100) * 100) / 100;