第十五週HTML+CSS+JavaScript+WORD轉pdf

利率y(rate)期數n(nper)金流m(pmt)終值f(fv)

參考劉任昌金融市場講義

蔡宛庭學習HTML+CSS+JavaScript程式碼


<style>
h1{border: 30px outset red;  
  background-color: green;  
  color: white;
  text-align: center;}
</style>
<script>
function computePV(){
  var r = document.getElementById("rate").value;
  var n = document.getElementById("nper").value;
  var m = document.getElementById("pmt").value;
  var f = document.getElementById("fv").value;
  pvif =r;
  pvif++;
  pvif =1/pvif**n;
  var pv = (1-pvif)*m/r + f * pvif;
  document.getElementById("pv").innerHTML = pv;
}
</script>
<body>
<table border="1">
<tr><td>利率y(rate)</td><td>期數n(nper)</td><td>金流m(pmt)</td><td>終值f(fv)</td></tr>
   <td><input id="rate" type="number"/></td>
   <td><input id="nper" type="number" /></td>
   <td><input id="pmt" type="number" /></td>
   <td><input id="fv" type="number" /></td></tr>
</table>
<input onclick="computePV()" type="button" value="計算現值" />
<p id="pv"></p>

<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo-X6PpV8228doL7IS7iUnuGiuBnjk7kurOa4ZvzykTqJjF56bGaW2wMtPHqh03JHd44SLQb9FH60rCzSyzDS209Y0oXVelalKC7vqXy5Lhgyd3CqnhiZ_Pl8E02M6xYqcmOdVD2BoESrN/s499/%25E6%2593%25B7%25E5%258F%2596.PNG" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" width="600" data-original-height="99" data-original-width="499" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo-X6PpV8228doL7IS7iUnuGiuBnjk7kurOa4ZvzykTqJjF56bGaW2wMtPHqh03JHd44SLQb9FH60rCzSyzDS209Y0oXVelalKC7vqXy5Lhgyd3CqnhiZ_Pl8E02M6xYqcmOdVD2BoESrN/s600/%25E6%2593%25B7%25E5%258F%2596.PNG"/></a></div>

<p>參考劉任昌金融市場講義https://drive.google.com/file/d/17z6UZgN5fC2XCO1L8_BQs57dgQXzbwou/view?usp=sharing<p>
<h1>蔡宛庭學習HTML+CSS+JavaScript程式碼<h1/>

</body>

人生三大境界

古今之成大事業、大學問者,必經過三種之境界:"昨夜西風凋碧樹。獨上高樓,望盡天涯路。"此第一境也。"衣帶漸寬終不悔,為伊消得人憔悴。"此第二境也。"眾里尋他千百度,驀然回首,那人卻在燈火闌珊處。"此第三境也。


留言

這個網誌中的熱門文章

EXCEL工作表群組,Query附加與合併資料表

第八週