Created
December 16, 2013 07:26
-
-
Save oldsharp/7983488 to your computer and use it in GitHub Desktop.
monthly pay calcualtor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def month_pay_calc(base, month_rate, month_count): | |
return (base * month_rate * ((month_rate+1.0)**month_count)) / \ | |
((month_rate+1.0)**month_count - 1.0) | |
base = 124 * 10000 | |
g_base_1 = 80 * 10000 | |
g_base_2 = 30 * 10000 | |
month_count = 12 * 30 | |
year_rate = 6.55 * 0.01 | |
g_year_rate = 4.50 * 0.01 | |
month_rate = year_rate / 12.0 | |
month_rate_95 = month_rate * 0.95 | |
month_rate_90 = month_rate * 0.9 | |
month_rate_85 = month_rate * 0.85 | |
month_rate_80 = month_rate * 0.80 | |
g_month_rate = g_year_rate / 12.0 | |
month_pay = month_pay_calc(base, month_rate, month_count) | |
month_pay_95 = month_pay_calc(base, month_rate_95, month_count) | |
month_pay_90 = month_pay_calc(base, month_rate_90, month_count) | |
month_pay_85 = month_pay_calc(base, month_rate_85, month_count) | |
month_pay_80 = month_pay_calc(base, month_rate_80, month_count) | |
print 'year_rate: {0}\tmonth_rate: {1}\tmonth_pay: {2}'.format( | |
year_rate, month_rate, month_pay) | |
print 'year_rate_95: {0}\tmonth_rate_95: {1}\tmonth_pay_95: {2}'.format( | |
year_rate * 0.95, month_rate_95, month_pay_95) | |
print 'year_rate_90: {0}\tmonth_rate_90: {1}\tmonth_pay_90: {2}'.format( | |
year_rate * 0.90, month_rate_90, month_pay_90) | |
print 'year_rate_85: {0}\tmonth_rate_85: {1}\tmonth_pay_85: {2}'.format( | |
year_rate * 0.85, month_rate_85, month_pay_85) | |
print 'year_rate_80: {0}\tmonth_rate_80: {1}\tmonth_pay_80: {2}'.format( | |
year_rate * 0.80, month_rate_80, month_pay_80) | |
g_month_pay_1 = month_pay_calc(g_base_1, g_month_rate, month_count) + \ | |
month_pay_calc(base-g_base_1, month_rate, month_count) | |
print g_month_pay_1 | |
g_month_pay_2 = month_pay_calc(g_base_2, g_month_rate, month_count) + \ | |
month_pay_calc(base-g_base_2, month_rate, month_count) | |
print g_month_pay_2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment