• Resolved UserDG

    (@tenkepadu)


    Hi, I have an equation and PMT function. But the result didn’t display

    Here the formulas

    (function calculateInterest( totalAmount, numberOfPayments ){
    var interest = 0;
    var totalAmount = fieldname1;
    var numberOfPayments = fieldname22;
    if(5000<=totalAmount && totalAmount<=12000)
    {
    if(numberOfPayments == 9) interest=0.994;
    else if(numberOfPayments == 12) interest=0.9351;
    else interest=0;
    }
    if(12001<=totalAmount && totalAmount<=30000)
    {
    if(numberOfPayments == 9) interest=0.9383;
    else if(numberOfPayments == 12) interest=0.917;
    else if(numberOfPayments == 15) interest=0.8607;
    else interest=0;
    }
    if(30001<=totalAmount && totalAmount<=60000)
    {
    if(numberOfPayments == 9) interest=0.9383;
    else if(numberOfPayments == 12) interest=0.8988;
    else if(numberOfPayments == 15) interest=0.8429;
    else if(numberOfPayments == 15) interest=0.7901;
    else interest=0;
    }
    return interest;
    }

    function calculatePresentValue( totalAmount,downpaymentAmount ){
    var downpaymentAmount = fieldname2;
    var presentValue = (totalAmount- downpaymentAmount);
    return presentValue;
    }

    function PMT(totalAmount,downpayment,presentValue,interest,numberOfPayments ) {

    var monthlyPayment = PMT( interest, numberOfPayments, presentValue )
    var fv=0;

    if( ! fv ){ fv = 0; }
    var PMT= ( interest * ( presentValue * POW( (interest +1), numberOfPayments ) + fv ) ) / ( ( interestRate + 1 ) * ( POW( (interest +1), numberOfPayments ) -1 ) );
    return pmt;
    }

    function calculateMonthlyPayment( interest,numberOfPayments,presentValue ){
    var monthlyPayment;

    return monthlyPayment = CEIL(PMT(presentValue/(1-(1/(1+interest/12)*EXP(numberOfPayments)))/interest/12)/12);
    })()

    http://www.homecredit.ph/2177-2/

    Please try it to Mobile product

    https://wordpress.org/plugins/calculated-fields-form/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Can't display the result’ is closed to new replies.