Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/89.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 需要帮助显示每月向客户付款和HTML估算。_Javascript_Html_Variables_Output_Liquid - Fatal编程技术网

Javascript 需要帮助显示每月向客户付款和HTML估算。

Javascript 需要帮助显示每月向客户付款和HTML估算。,javascript,html,variables,output,liquid,Javascript,Html,Variables,Output,Liquid,我有一个评估系统,允许我插入html代码。我们已经开始提供一些融资。我能够插入贷款计算器的代码,但我们知道贷款的长度、利率和估计的总金额。我需要弄清楚如何设置输入项,其中job total“{{charge.total | currency}}”是唯一的变量。我希望输出的句子(不是表格)如下所示: 我们可以以4月9.99%的利率为您提供132个月的融资计划 每月向您支付接近XXX.xx美元的小额付款 有人告诉我,stack over flow中充满了喜欢小改动的聪明程序员。我也很高兴如果有人知道

我有一个评估系统,允许我插入html代码。我们已经开始提供一些融资。我能够插入贷款计算器的代码,但我们知道贷款的长度、利率和估计的总金额。我需要弄清楚如何设置输入项,其中job total“{{charge.total | currency}}”是唯一的变量。我希望输出的句子(不是表格)如下所示:

我们可以以4月9.99%的利率为您提供132个月的融资计划 每月向您支付接近XXX.xx美元的小额付款

有人告诉我,stack over flow中充满了喜欢小改动的聪明程序员。我也很高兴如果有人知道一个企业,将有助于这种类型的小编码问题

下面是我尝试重新使用的代码:

<script language="JavaScript">
<!--
function showpay() {
 if ((document.calc.loan.value == null || document.calc.loan.value.length == 0) ||
     (document.calc.months.value == null || document.calc.months.value.length == 0)
||
     (document.calc.rate.value == null || document.calc.rate.value.length == 0))
 { document.calc.pay.value = "Incomplete data";
 }
 else
 {
 var princ = document.calc.loan.value;
 var term  = document.calc.months.value;
 var intr   = document.calc.rate.value / 1200;
 document.calc.pay.value = princ * intr / (1 - (Math.pow(1/(1 + intr), term)));
 }

// payment = principle * monthly interest/(1 - (1/(1+MonthlyInterest)*Months))

}

// -->
</script>

The results of this loan payment calculator are for comparison purposes only.
They will be a close approximation of actual loan
repayments if available at the terms entered, from a financial institution. This
is being
provided for you to plan your next loan application. To use, enter values
for the
Loan Amount, Number of Months for Loan, and the Interest Rate (e.g.
7.25), and
click the Calculate button. Clicking the Reset button will clear entered
values.
<p>
<center>
<form name=calc method=POST>
<table width=30% border=5>
<tr><th bgcolor="#aaaaaa" width=25%><font color=black>Description</font></th>
<th bgcolor="#aaaaaa" width=25%><font color=black>Data Entry</font></th></tr>
<tr><td bgcolor="#eeeee">Loan Amount</td><td bgcolor="#eeeee" align=right><input
type=text name=loan
size=10></td></tr>
<tr><td bgcolor="#eeeee">Loan Length in Months </td><td bgcolor="#eeeee"
align=right>(Terms 132mo 47mo 37mo)<input type=text
name=months size=3></td></tr>
<tr><td bgcolor="#eeeee">Interest Rate </td><td bgcolor="#eeeee" align=right>( Rates 9.99%  7.99% 5.99%)<input
type=text name=rate
size=3></td></tr>
<tr><td bgcolor="#eeeee">Monthly Payment</td><td bgcolor="#2E64FE"
align=right><em>Calculated</em> <input
type=text name=pay size=10></td></tr>
<tr><td  bgcolor="#eeeee"align=center><input type=button onClick='showpay()'
value=Calculate></td><td bgcolor="#eeeeee" align=center><input type=reset
value=Reset></td></tr>
</table>
</form>
<font size=1>Enter only numeric values (no commas), using decimal points
where needed.<br>
Non-numeric values will cause errors.</font>
</center>

此贷款支付计算器的结果仅供比较之用。
它们将与实际贷款接近
从金融机构按输入的条款偿还(如有)。这
正在
提供给您计划下一次贷款申请。要使用,请输入值
对于
贷款金额、贷款月数和利率(例如。
7.25)及
单击“计算”按钮。单击重置按钮将清除已输入的内容
价值观

描述
数据输入
贷款金额
以月为单位的贷款期限(期限132mo 47mo 37mo)
利率(利率9.99%7.99%5.99%)
月薪计算
仅输入数字值(无逗号),使用小数点
需要的地方。
非数值将导致错误。
月度融资计划示例
欲了解更多信息,请访问我们的网站

http://www.generation3electric.com/financing“target=“\u blank”>www.GEN3Electric.com
**4月0%的12个月融资计划,每月支付{job.total |除以:12 | currency}}

window.onload=函数showpay(){

var princ=“{{job.total}}”;
变量term1=132;
var intr1=9.99/1200;
var intrrate1=9.99;
var-term2=47;
var intr2=7.99/1200;
var intrrate2=7.99;
var-term3=37;
var intr3=5.99/1200;
var intrrate3=5.99;
风险价值成本1=原则*intr1/(1-(数学功率(1/(1+intr1),术语1));
风险价值成本2=原则*intr2/(1-(数学功率(1/(1+intr2),第2项));
风险价值成本3=原则*intr3/(1-(数学功率(1/(1+intr3),第3项));
var payment1=数学轮(成本1);
var payment2=数学轮(成本2);
var payment3=数学轮(成本3);
var content=“**A”
+术语1
+“月融资计划在”
+intrrate1+%APR,将为您提供接近美元的每月付款”
+报酬1
+“**
**A” +term2+“月融资计划” +intrrate2+%APR,将为您提供接近美元的每月付款” +付款2+“**
**A” +条款3+“月融资计划”在“+intrrate3” +%APR,它将为您提供接近美元的每月付款 +报酬3 +“**
”; document.getElementById(“financing”).innerHTML=content;
}

var princ = "{{ job.total }}";

var term1 = 132;
var intr1 = 9.99 / 1200;
var intrrate1 = 9.99;

var term2 = 47;
var intr2 = 7.99 / 1200;
var intrrate2 = 7.99;

var term3 = 37;
var intr3 =5.99 / 1200;
var intrrate3 = 5.99;

var cost1 = princ * intr1 / (1 - (Math.pow(1 / (1 + intr1), term1)));
var cost2 = princ * intr2 / (1 - (Math.pow(1 / (1 + intr2), term2)));
var cost3 = princ * intr3 / (1 - (Math.pow(1 / (1 + intr3), term3)));
var payment1 = Math.round(cost1);
var payment2 = Math.round(cost2);
var payment3 = Math.round(cost3);
var content = "**A  " 
              + term1 
              + " month financing plan at " 
              + intrrate1 + "% APR that will give you a monthly payment close to $"
              + payment1 
              +".**<BR> **A "
              + term2 + " month financing plan at " 
              + intrrate2 + "% APR that will give you a monthly payment close to $"
              + payment2 + ".**<BR>**A  " 
              + term3 + " month financing plan at " + intrrate3 
              + "% APR that will give you a monthly payment close to $"
              + payment3
              + ".**<BR>"   ;
document.getElementById("financing").innerHTML = content;