How can I handle this string so that it returns only 2 decimals after the point?
$(".subtotal2").text(23.90);
var sum = 0;
$(".subtotal2").each(function() {
var val = $.trim( $(this).text() );
if (val) { val = parseFloat( val.replace( /^\$/, "" ) ); sum += !isNaN( val ) ? val : 0; }
});
$(".todo_total").text(sum*12);
This code for now returns this to me: