English 中文(简体)
页: 1 薪酬利息计算师——从每月付款中计算信贷数额
原标题:jQuery interest calculator - calculate amount of credit from monthly payment

我写了小的“金”利害关系标记。

  • it is calculating amount of credit from monthly re-payment

<>

www.un.org/Depts/DGACM/index_spanish.htm 问题是,我的利息计算逻辑完全是错误的。

look:

//Get the value - monhtly repayment
var InputedValue = $( form input[name="val1"] ).val();

// 12 ,18, 24, 30, 36 - NumberOfMonths
for (var i = 12; i <= 36; i += 12) {

    // j = 20 - Deposit in %
    for (var j = 10; j <= 10; j += 10) {

        // g = 20, 30 - InterestPerYear in %
        for (var g = 10; g <= 10; g += 10) {

            var InScaleOfYear = i / 12;

            // Amount of payment excluding deposit
            var AmountOfPayments = (InputedValue * (i - 1)); // rat bedzie o jedna mniej niz ilosc miesiecy, bo wplata poczatkowa
            // Amount of payment including deposit
            var AmountInTotal = (AmountOfPayments * 100) / (100 - j);

            // Deposit 
            var Deposit = AmountInTotal - AmountOfPayments;

            // Amount of payment in one year 
            var AmountOfPaymentInOneYear = (AmountOfPayments / InScaleOfYear);
            var InterestPerYear = ((AmountOfPaymentInOneYear * g) / 100);

            // Interest in total
            var InterestInTotal = InterestPerYear * InScaleOfYear;

            // Amount of credit
            var AmountOfCredit = (AmountOfPayments + Deposit) - InterestInTotal;

            $( table tbody ).append( <tr><td>  
            + i +  </td><td>  
            + "at " + j + "% = " + Deposit.toFixed(2) +  </td><td>  
            + "at " + g + "% = " + InterestPerYear.toFixed(2) +  </td><td>  
            + "at " + g + "% = " + InterestInTotal.toFixed(2) +  </td><td>  
            + AmountOfPayments.toFixed(2) +  </td><td>  
            + AmountInTotal.toFixed(2) +  </td><td>  
            + AmountOfCredit.toFixed(2) +  </td></tr> );

        }
    }
}

任何从事类似工作的人? • 我如何在以下信息中计算利息:

  • number of month / years (i = months)
  • amount of monthly payment ($( form input[name="val1"] ).val();)
  • amount of the deposit (j = deposit)
  • interest rate (g = interest rate)

www.un.org/Depts/DGACM/index_spanish.htm 如你所看到,休息时间为几个月/月/月/日。 仅需要一些帮助,以计算对 lo的兴趣。

最佳回答

你的措辞有些混淆。 但我的理解是,你想说明,根据每月付款和某些利率,一个人能够支付多少信贷。 正如其他人指出的那样,你首先需要在纸上这样做,以确保你有正确的利益类型和复杂时期的公式。 但是,这并不是StackOver的花招,我们在这里强调方案规划! 因此,允许以复合利息和月付款为信用卡作贷款(如果需要,可以重新制定任何其他公式)。

我为这些公式找到的最佳资源如下:,Loan或投资公式。 这一页的复合公式已经预先确定,几乎没有任何变数! 因此,你无需记住,从大学到商业数学课。 尼斯。

因此,我们现在需要将正确的公式转化为 Java。 这正是我们的冲绳之客希望看到的! 我们的情况是:

  • A = Total Loan Amount
  • P = Monthly Payment Amount
  • N = Number of Months
  • i = APR Interest Rate/12

A = (P/i) [1-(1+i)^-N]

  1. Ok so lets change out the square brackets for normal brackets. A = (P/i)(1-(1+i)^-N)
  2. Now we don t want JavaScript to think that first term is a method, we want it to multiply them. So lets add the asterisk. A = (P/i) * (1 - (1+i)^-N)
  3. JavaScript thinks a caret is a bitwise XOR operator, so for powers lets use Math.pow() instead. A = (P/i) * (1 - Math.pow((1+i),(-N))
  4. Done! 这可以在 Java文中发挥作用。 • 如何用舒适的可变姓名进行人类可读样本?

    var MonthlyPaymentAmount = parseFloat($( #txtMonthlyPayment ).val());
    var APR = 16.9 / 100;   //16.9% APR
    var InterestRate = (APR / 12);     //monthly interest
    
    for (var nMonths = 12; nMonths <= 36; nMonths += 12) {
        var TotalAmountOfPayments = nMonths * MonthlyPaymentAmount;
    
        var TotalAmountOfCredit = (MonthlyPaymentAmount / InterestRate) * (1 - Math.pow((1 + InterestRate), (-nMonths)));
    
        var TotalAmountOfInterest = TotalAmountOfPayments - TotalAmountOfCredit;
    
        alert("Total Loan Amount: $" + TotalAmountOfCredit + "Total Paid:" + TotalAmountOfPayments + ", Interest:" + TotalAmountOfInterest);
    }
    

你们来了! 这笔费用根据一些月度付款、特定养老金计划利率和12,24和amp计算出可动用信贷总额;36个月期限。 如果这确实是你所铭记的目标,就读到数学辅导,并选择另一种语言,将读写成 Java!

问题回答

主要问题是,你通过采用非表率的方法,重新努力解决lus问题。 如果你知道,Calculus是数学的一个分支,基本上试图解决X/0问题。 就复合利息而言,它是一个贪 gr的银行试图从利息中尽可能多地挤出钱财的案例。

这开始是每月的利息,但是他们认识到,如果他们每天收取费用,他们会得到更多的赔偿。 这符合同样的利益,即每月10%,日数为每天1/3%。 这是因为前一天的利息是下一个利息周期(或复合)计算的一部分。 如果它们每小时、每分钟、每秒、直到基本上成为“重大利益”时,它们就会增加。 因此,产生复合利息。

(由于民众感受和混淆,政府授权使用APR这一术语,将复合利息百分比转化为我们正常人民可以适用的“年度利率”。) 因此,如果它说APR,而且大多数这样做,就会引起复合兴趣。

利息是X/0的问题,因为你试图获得instant<>em> interest. 。 Wikipedia关于复合利息的条款应为计算复合利息提供一些有用的公式。 然而,在使用类似公式时,必须记住的是,你只能拿APR这样的东西,而只有12人才能获得经营技术。 否则,它不会引起复合利益,而并非简单。

Try this page below, it also contains excel spreadsheet which helps greatly.

http://www.yorku.ca/amarshal/mortgage.htm

If you can follow the excel calculations in your head, you can slap out the code easily.

" I spent 4 years to graduate with a Math degree, only to have my prof tell me what I learnt is absolutely true but totally useless "

It really depends on the type of interest you re looking for (compound/simple/etc). For examples I d look here: http://www.hotscripts.com/search/javascript/interest

Use the formula

A=P(1+r/n)^nt

where, A :future value with interest P :principle amount r :annual interest(decimal) n : no. of times interest is compounded per year t : no. of years for which money is invested

Convert r value to float value by dividing it by 100 after accepting int value from user. Provide radio button to select type of investment like quarterly, monthly, yearly etc accordingly you can set n value by using if condition.

因此,你可以使用单一功能计算任何类型的利息。





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签