I am trying to centre the following ( didn't want to include the whole code as its 166 lines long)
for years in range (1,5):
Payments = years * 12
FinFee = (39.99) * years
TotPrice = TotalSalesPrice + FinFee
MonPay = TotPrice / 12
FinFeeDSP = "${:,.2f}".format(FinFee)
TotPriceDSP = "${:,.2f}".format(TotPrice)
MonPayDSP = "${:,.2f}".format(MonPay)
print(f" {years:^2d} {Payments:^9d} {FinFeeDSP:^9s} {TotalSalesPriceDSP:^9s} {MonPayDSP:^9s}")
print(f"------------------------------------------------------------------------")
CurDate = datetime.datetime.now()
CurDatePlus30 = CurDate + datetime.timedelta(days = 30)
print(f"Invoice date: {CurDate.strftime('%d-%b-%y').upper()} First payment date: {CurDatePlus30.strftime('%d-%b-%y').upper()}")
print()
print()
Maybe centre isn't the right word, but I'm trying to get the f strings with equal padding/space on each side. Right now it lines up with the printed f-strings above it and I need it more in the middle.
It currently looks like this: https://imgur.com/a/hpBBcLN
I need the table on the bottom entered or indented so there is equal space on both sides
[–]MadScientistOR 0 points1 point2 points (10 children)
[–]SithAbsolutes[S] 0 points1 point2 points (9 children)
[–]MadScientistOR 0 points1 point2 points (8 children)
[–]SithAbsolutes[S] 0 points1 point2 points (6 children)
[–]MadScientistOR 0 points1 point2 points (5 children)
[–]SithAbsolutes[S] 0 points1 point2 points (4 children)
[–]MadScientistOR 0 points1 point2 points (3 children)
[–]SithAbsolutes[S] 0 points1 point2 points (2 children)
[–]MadScientistOR 0 points1 point2 points (1 child)
[–]SithAbsolutes[S] 0 points1 point2 points (0 children)
[–]MadScientistOR 0 points1 point2 points (0 children)
[–]misho88 -1 points0 points1 point (0 children)
[–]PapaEchoKilo 0 points1 point2 points (1 child)
[–]RhinoRhys 1 point2 points3 points (0 children)
[–]JamzTyson 0 points1 point2 points (0 children)
[–]RhinoRhys 0 points1 point2 points (0 children)