NPV总计将使用Microsoft Excel中的计算。
具体来说:“年1 + NPV(0.08,年2 + 0,年3 + 0,年4 + 0,年5 + 0)”,使用NET行作为值和“购买与租赁”的“租赁”部分的“租赁”行中的值。
我用jquery来显示总数:
$(document).ready(function () {
//iterate through each textboxes and add keyup
//handler to trigger sum event
$(".txBxCashFlowNetYear1").each(function () {
$(this).keyup(function () {
alert();
calculateSum();
});
});
});
function calculateSum() {
var sum = 0;
//iterate through each textboxes and add the values
$(".txBxCashFlowNetYear1").each(function () {
//add only if the value is number
if (!isNaN(this.value) && this.value.length != 0) {
sum += parseFloat(this.value);
}
});
//.toFixed() method will roundoff the final sum to 2 decimal places
$("#txBxCashF