需要帮助向客户显示每月付款和 HTML 估算
Need help showing a monthly payment to customer and HTML estimate.
我有一个估算系统,允许我插入html代码。我们已经开始提供一些融资。我能够插入贷款计算器的代码,但我们知道贷款的长度,利率和估计的总金额。我需要弄清楚如何使用作业总数设置输入项" {{ charge.total |货币 }}"是唯一的变量。我希望输出一个句子(不是表格),内容如下:
我们可以为您提供132个月的融资计划,年利率为9.99%,这将 每月给您接近$XXX.xx_____Small打印的付款
有人告诉我,堆栈流充满了喜欢小改动的聪明编码员。如果有人知道一家企业可以帮助解决这种类型的小编码问题,我也很高兴。
这是我试图重新利用的代码:
<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>
月融资计划示例
欲了解更多信息,请访问我们的网站。
http://www.generation3electric.com/financing" 目标="_blank">www.GEN3Electric.com
**12个月的融资计划,年利率为0%,每月支付{{ job.total |divided_by:12| 货币 }}
window.onload = 函数 showpay() {
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;
;}
相关文章:
- 可以't让我的if语句处理js中的html表单输入
- 如何设置html元素填充的动画
- 使用JS如何动态更改显示的html文件中的文本背景颜色
- 如何将HTML id分配给元素,以及如何将JavaScript应用于元素
- 如何编写HTML输入的JS内联
- Dojo不解析自定义小部件的模板html中的小部件声明性
- 使用javascript将动态表从一个html页面打印到另一个html页
- 通过javascript重定向html传递php变量
- 如何使Javascript动态html表及其上的事件
- 在chrome.tabs.onCreated之后加载HTML页面
- 如何在vs2002中调试html页面
- 如何使用javascript或html下载PDF格式的填写表单
- 视频HTML没有'无法在Internet Explorer 11上工作
- HTML表单提交时未执行外部函数
- 如何将输入(type=text)从html表单传递到javascript函数
- 使用angular重定向到html页面
- 分析高度属性时出现意外值{{specs.height}}.index.html
- 在html Select中添加搜索
- 多级HTML表单
- 需要帮助向客户显示每月付款和 HTML 估算