]> Zhao Yanbai Git Server - acecode.git/commitdiff
...
authoracevest <zhaoyanbai@126.com>
Fri, 21 Oct 2022 12:07:51 +0000 (20:07 +0800)
committeracevest <zhaoyanbai@126.com>
Fri, 21 Oct 2022 12:07:51 +0000 (20:07 +0800)
tools/comm/EqualPrincipalAndInterest.py [new file with mode: 0755]

diff --git a/tools/comm/EqualPrincipalAndInterest.py b/tools/comm/EqualPrincipalAndInterest.py
new file mode 100755 (executable)
index 0000000..d5d4c9e
--- /dev/null
@@ -0,0 +1,28 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+# ------------------------------------------------------------------------
+#   File Name: EqualPrincipalAndInterest.py
+#      Author: Zhao Yanbai
+#              2022-05-25 18:36:12 Wednesday CST
+# Description: none
+# ------------------------------------------------------------------------
+
+import math
+
+total = 420*10000
+year=30
+yearRate = 0.0588
+
+
+monthCount = year * 12
+monthRate = yearRate / 12.0
+
+
+
+r = math.pow(1+monthRate, monthCount)
+
+X = total*monthRate*r / (r - 1)
+
+X = round(X, 2)
+
+print(X)