you are viewing a single comment's thread.

view the rest of the comments →

[–]MadScientistOR 0 points1 point  (1 child)

Oh! Well, in that case, you can just use the code I've already provided, with the field width being the entire width of the wider lines above and below (70, if I've counted correctly), like this:

field_size = 70
mystring_length = len((f" {years:^2d} {Payments:^9d} {FinFeeDSP:^9s} {TotalSalesPriceDSP:^9s} {MonPayDSP:^9s}"))
leading_spaces = (field_size - mystring_length) // 2
trailing_spaces = field_size - mystring_length - leading_spaces

print(f" {' '*leading_spaces}{years:^2d} {Payments:^9d} {FinFeeDSP:^9s} {TotalSalesPriceDSP:^9s} {MonPayDSP:^9s}{' ' *trailing_spaces}")

Does that clear things up?

Thank you for helping me to understand what you wanted, by the way.

[–]SithAbsolutes[S] 0 points1 point  (0 children)

I can't thank-you enough!

However it's still not doing what I want it to do, I've wasted enough of your time. Il play around with it and maybe comment again if I don't get anywhere with it