The JavaScript code goes as follows:
var receivedamt = parseFloat($('#cashRecText').val()).toFixed(2);
console.log(receivedamt);
var addon = parseFloat('5.00').toFixed(2);
console.log(addon);
addon = parseFloat(receivedamt).toFixed(2) + parseFloat(addon).toFixed(2);
console.log(addon);
However, the output shows:
3.00
5.00
3.005.00
How can we achieve a sum of
8.00