From: acevest Date: Fri, 21 Oct 2022 12:07:51 +0000 (+0800) Subject: ... X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/doc/topojson.min.js?a=commitdiff_plain;h=dfcc85886a69e538fda46428d9a1585b6cdbda7b;p=acecode.git ... --- diff --git a/tools/comm/EqualPrincipalAndInterest.py b/tools/comm/EqualPrincipalAndInterest.py new file mode 100755 index 0000000..d5d4c9e --- /dev/null +++ b/tools/comm/EqualPrincipalAndInterest.py @@ -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)