$("#btnReviewAndSave").click(function () { var curSum = '@ViewBag.curSum'; var cdPayment = '@ViewBag.CdPayment'; var cdPaymentTotal = cdPayment + 200; if (curSum > cdPayment + 200) { if (!confirm('The Advertising Payment of $' + curSum + ' exceeds the allocated Advertising amount by $ ' + cdPaymentTotal + '. Do you want to Save?')) { return false; } } });
Try this var curSum = parseFloat(@ViewBag.Number);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)