mortgage icon indicating copy to clipboard operation
mortgage copied to clipboard

Need prettier print representation of amortization schedule

Open austinmcconnell opened this issue 8 years ago • 1 comments

Loan.schedule is fairly ugly right now. Need to format with header row and values in columns. Is current data structure {payment_number:{principal:'', interest:'', balance:''...} a good format for this? Should I switch the inner dictionary to be a named tuple or something else?

austinmcconnell avatar Feb 12 '17 13:02 austinmcconnell

I like it the way it is, providing a list of installments which users of your package can format how they like. Here's one that works for me:

for installment in loan.schedule():
	print('{:>4}: {:>10.02f} {:>10.02f} {:>10.02f} {:>10.02f}'.format(
		installment.number, installment.payment, installment.interest, installment.principal, installment.balance))

lwerdna avatar Apr 16 '21 21:04 lwerdna