Skip to content

Instantly share code, notes, and snippets.

@jhannah
Created December 16, 2021 20:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhannah/4c74c240ba987edea6e5f0f72a342ab3 to your computer and use it in GitHub Desktop.
Save jhannah/4c74c240ba987edea6e5f0f72a342ab3 to your computer and use it in GitHub Desktop.
Amortization schedule w/ principle-only payments
Here's a little Perl script I wrote:
https://github.com/jhannah/sandbox/blob/main/amortize.pl
✗ ./amortize.pl
Usage:
amortize.pl --principle=176000 --periods=180 --interest_rate=2.13 \
--principle_payment=12:2000 \
--principle_payment=24:2000
Take out a $176,000 loan over 15 years at 2.13% APR.
But make a $2,000 principle-only payment after payment #12.
And another after payment #24.
Those extra payments shorten the number of payments we have to make,
and make the last payment smaller.
✗ ./amortize.pl --principle=176000 --periods=180 --interest_rate=2.13 \
--principle_payment=12:2000 \
--principle_payment=24:2000
# Payment Int Princ Balance
--- -------- ------ -------- ----------
1 1,143.14 312.40 830.74 175,169.26
2 1,143.14 310.93 832.22 174,337.04
3 1,143.14 309.45 833.69 173,503.35
4 1,143.14 307.97 835.17 172,668.18
5 1,143.14 306.49 836.66 171,831.52
6 1,143.14 305.00 838.14 170,993.38
7 1,143.14 303.51 839.63 170,153.75
8 1,143.14 302.02 841.12 169,312.63
9 1,143.14 300.53 842.61 168,470.02
10 1,143.14 299.03 844.11 167,625.91
11 1,143.14 297.54 845.61 166,780.31
12 1,143.14 296.04 847.11 165,933.20
Principle-only payment made:
2,000.00 163,933.20
13 1,143.14 290.98 852.16 163,081.04
14 1,143.14 289.47 853.67 162,227.37
15 1,143.14 287.95 855.19 161,372.18
16 1,143.14 286.44 856.71 160,515.48
17 1,143.14 284.91 858.23 159,657.25
18 1,143.14 283.39 859.75 158,797.50
19 1,143.14 281.87 861.28 157,936.22
20 1,143.14 280.34 862.80 157,073.42
21 1,143.14 278.81 864.34 156,209.08
22 1,143.14 277.27 865.87 155,343.21
23 1,143.14 275.73 867.41 154,475.81
24 1,143.14 274.19 868.95 153,606.86
Principle-only payment made:
2,000.00 151,606.86
25 1,143.14 269.10 874.04 150,732.82
26 1,143.14 267.55 875.59 149,857.23
27 1,143.14 266.00 877.14 148,980.08
28 1,143.14 264.44 878.70 148,101.38
29 1,143.14 262.88 880.26 147,221.12
30 1,143.14 261.32 881.82 146,339.30
31 1,143.14 259.75 883.39 145,455.91
32 1,143.14 258.18 884.96 144,570.95
33 1,143.14 256.61 886.53 143,684.42
34 1,143.14 255.04 888.10 142,796.32
35 1,143.14 253.46 889.68 141,906.64
36 1,143.14 251.88 891.26 141,015.38
37 1,143.14 250.30 892.84 140,122.55
38 1,143.14 248.72 894.42 139,228.12
39 1,143.14 247.13 896.01 138,332.11
40 1,143.14 245.54 897.60 137,434.51
41 1,143.14 243.95 899.20 136,535.31
42 1,143.14 242.35 900.79 135,634.52
43 1,143.14 240.75 902.39 134,732.13
44 1,143.14 239.15 903.99 133,828.14
45 1,143.14 237.54 905.60 132,922.54
46 1,143.14 235.94 907.20 132,015.34
47 1,143.14 234.33 908.81 131,106.52
48 1,143.14 232.71 910.43 130,196.10
49 1,143.14 231.10 912.04 129,284.05
50 1,143.14 229.48 913.66 128,370.39
51 1,143.14 227.86 915.28 127,455.11
52 1,143.14 226.23 916.91 126,538.20
53 1,143.14 224.61 918.54 125,619.66
54 1,143.14 222.97 920.17 124,699.50
55 1,143.14 221.34 921.80 123,777.70
56 1,143.14 219.71 923.44 122,854.26
57 1,143.14 218.07 925.08 121,929.18
58 1,143.14 216.42 926.72 121,002.47
59 1,143.14 214.78 928.36 120,074.10
60 1,143.14 213.13 930.01 119,144.09
61 1,143.14 211.48 931.66 118,212.43
62 1,143.14 209.83 933.31 117,279.12
63 1,143.14 208.17 934.97 116,344.15
64 1,143.14 206.51 936.63 115,407.52
65 1,143.14 204.85 938.29 114,469.22
66 1,143.14 203.18 939.96 113,529.27
67 1,143.14 201.51 941.63 112,587.64
68 1,143.14 199.84 943.30 111,644.34
69 1,143.14 198.17 944.97 110,699.37
70 1,143.14 196.49 946.65 109,752.72
71 1,143.14 194.81 948.33 108,804.39
72 1,143.14 193.13 950.01 107,854.37
73 1,143.14 191.44 951.70 106,902.67
74 1,143.14 189.75 953.39 105,949.28
75 1,143.14 188.06 955.08 104,994.20
76 1,143.14 186.36 956.78 104,037.43
77 1,143.14 184.67 958.48 103,078.95
78 1,143.14 182.97 960.18 102,118.77
79 1,143.14 181.26 961.88 101,156.89
80 1,143.14 179.55 963.59 100,193.31
81 1,143.14 177.84 965.30 99,228.01
82 1,143.14 176.13 967.01 98,261.00
83 1,143.14 174.41 968.73 97,292.27
84 1,143.14 172.69 970.45 96,321.82
85 1,143.14 170.97 972.17 95,349.65
86 1,143.14 169.25 973.90 94,375.75
87 1,143.14 167.52 975.62 93,400.13
88 1,143.14 165.79 977.36 92,422.77
89 1,143.14 164.05 979.09 91,443.68
90 1,143.14 162.31 980.83 90,462.85
91 1,143.14 160.57 982.57 89,480.28
92 1,143.14 158.83 984.31 88,495.97
93 1,143.14 157.08 986.06 87,509.91
94 1,143.14 155.33 987.81 86,522.10
95 1,143.14 153.58 989.56 85,532.53
96 1,143.14 151.82 991.32 84,541.21
97 1,143.14 150.06 993.08 83,548.13
98 1,143.14 148.30 994.84 82,553.29
99 1,143.14 146.53 996.61 81,556.68
100 1,143.14 144.76 998.38 80,558.30
101 1,143.14 142.99 1,000.15 79,558.15
102 1,143.14 141.22 1,001.93 78,556.22
103 1,143.14 139.44 1,003.70 77,552.52
104 1,143.14 137.66 1,005.49 76,547.03
105 1,143.14 135.87 1,007.27 75,539.76
106 1,143.14 134.08 1,009.06 74,530.70
107 1,143.14 132.29 1,010.85 73,519.85
108 1,143.14 130.50 1,012.64 72,507.21
109 1,143.14 128.70 1,014.44 71,492.77
110 1,143.14 126.90 1,016.24 70,476.53
111 1,143.14 125.10 1,018.05 69,458.48
112 1,143.14 123.29 1,019.85 68,438.63
113 1,143.14 121.48 1,021.66 67,416.97
114 1,143.14 119.67 1,023.48 66,393.49
115 1,143.14 117.85 1,025.29 65,368.20
116 1,143.14 116.03 1,027.11 64,341.08
117 1,143.14 114.21 1,028.94 63,312.15
118 1,143.14 112.38 1,030.76 62,281.38
119 1,143.14 110.55 1,032.59 61,248.79
120 1,143.14 108.72 1,034.42 60,214.37
121 1,143.14 106.88 1,036.26 59,178.11
122 1,143.14 105.04 1,038.10 58,140.01
123 1,143.14 103.20 1,039.94 57,100.06
124 1,143.14 101.35 1,041.79 56,058.27
125 1,143.14 99.50 1,043.64 55,014.64
126 1,143.14 97.65 1,045.49 53,969.15
127 1,143.14 95.80 1,047.35 52,921.80
128 1,143.14 93.94 1,049.21 51,872.59
129 1,143.14 92.07 1,051.07 50,821.53
130 1,143.14 90.21 1,052.93 49,768.59
131 1,143.14 88.34 1,054.80 48,713.79
132 1,143.14 86.47 1,056.67 47,657.12
133 1,143.14 84.59 1,058.55 46,598.57
134 1,143.14 82.71 1,060.43 45,538.14
135 1,143.14 80.83 1,062.31 44,475.83
136 1,143.14 78.94 1,064.20 43,411.63
137 1,143.14 77.06 1,066.09 42,345.54
138 1,143.14 75.16 1,067.98 41,277.57
139 1,143.14 73.27 1,069.87 40,207.69
140 1,143.14 71.37 1,071.77 39,135.92
141 1,143.14 69.47 1,073.68 38,062.24
142 1,143.14 67.56 1,075.58 36,986.66
143 1,143.14 65.65 1,077.49 35,909.17
144 1,143.14 63.74 1,079.40 34,829.77
145 1,143.14 61.82 1,081.32 33,748.45
146 1,143.14 59.90 1,083.24 32,665.21
147 1,143.14 57.98 1,085.16 31,580.05
148 1,143.14 56.05 1,087.09 30,492.97
149 1,143.14 54.13 1,089.02 29,403.95
150 1,143.14 52.19 1,090.95 28,313.00
151 1,143.14 50.26 1,092.89 27,220.11
152 1,143.14 48.32 1,094.83 26,125.29
153 1,143.14 46.37 1,096.77 25,028.52
154 1,143.14 44.43 1,098.72 23,929.80
155 1,143.14 42.48 1,100.67 22,829.14
156 1,143.14 40.52 1,102.62 21,726.52
157 1,143.14 38.56 1,104.58 20,621.94
158 1,143.14 36.60 1,106.54 19,515.40
159 1,143.14 34.64 1,108.50 18,406.90
160 1,143.14 32.67 1,110.47 17,296.43
161 1,143.14 30.70 1,112.44 16,183.99
162 1,143.14 28.73 1,114.41 15,069.58
163 1,143.14 26.75 1,116.39 13,953.18
164 1,143.14 24.77 1,118.37 12,834.81
165 1,143.14 22.78 1,120.36 11,714.45
166 1,143.14 20.79 1,122.35 10,592.10
167 1,143.14 18.80 1,124.34 9,467.76
168 1,143.14 16.81 1,126.34 8,341.42
169 1,143.14 14.81 1,128.34 7,213.09
170 1,143.14 12.80 1,130.34 6,082.75
171 1,143.14 10.80 1,132.34 4,950.41
172 1,143.14 8.79 1,134.35 3,816.05
173 1,143.14 6.77 1,136.37 2,679.68
174 1,143.14 4.76 1,138.39 1,541.30
175 1,143.14 2.74 1,140.41 400.89
176 401.60 0.71 400.89 0.00
Total interest paid: 28,451.37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment