I'm using this snippet to calculate the sum of two table cells.
var sum = 0;
$('.amount').each(function(){
sum += parseFloat($(this).text());
});
$('.sum').text(sum);
But when the sum is for example 40.00 it displays as 40 and as picky as I am, i want it to display as 40.00. So... what to do?
Little (editable) demo: https://codepen.io/gentlemedia/pen/gGXJgR