Fixes an issue when Sum has ",", and a spelling mistake.

This commit is contained in:
Jonathan Rosenbaum
2015-01-12 06:00:51 +00:00
parent c1a33b7076
commit a44e5e93f2
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -133,7 +133,8 @@ $(function() {
$("#" + k + "_sum span").text("$" + sum.toFixed(2));
// Difference
var deposit_amount = $('input[name="' + k + '"]').parent().prev().prev().text().replace(/\$(\d*\.\d*)\s+/, "$1" );
var deposit_amount = $('input[name="' + k + '"]').parent().prev().prev().text().replace(/\$(\d*(?:,\d{3})*\.\d*)\s+/, "$1" );
deposit_amount = deposit_amount.replace(/,/, "");
if (deposit_amount != 0) {
var diff = deposit_amount - sum;
$("#" + k + "_difference span").text("$"+ diff.toFixed(2));