.NET中的APR计算器

时间:2009-07-29 11:14:02

标签: c# .net math apr

我在哪里可以找到适合英国业务的良好APR计算器功能..

1 个答案:

答案 0 :(得分:0)

private double GetAPR()
{

    int i = 0;
    for (;;)
    {

        apr = (rate*((Math.Pow((1 + rate), duration))) /
              ((Math.Pow((1 + rate), duration)) - 1)) - 
              (installment/(loanamount - extracost));
        if (apr >= 0)
        {
            lblapr.Text = apr.ToString() + " + " + i.ToString();
            break;
        }
        else
        {
            i++;
            rate = rate*1200;
            rate = Math.Round(rate, 3);
            rate = rate + 0.01;
            rate = rate/1200;
        }
    }

    return rate;
}