Here is my code (well, some of them). I have a question: can I get the first 9 numbers to show with leading 00 and digits 10 - 99 with leading 0.
I need to show all 360 monthly payments, but if I donβt have all the month numbers on the same length, I get an output file that moves to the right and compensates for the appearance of the output,
System.out.print((x + 1) + " "); // the payment number System.out.print(formatter.format(monthlyInterest) + " "); // round our interest rate System.out.print(formatter.format(principleAmt) + " "); System.out.print(formatter.format(remainderAmt) + " "); System.out.println();
Results:
8 $951.23 $215.92 $198,301.22 9 $950.19 $216.95 $198,084.26 10 $949.15 $217.99 $197,866.27 11 $948.11 $219.04 $197,647.23
What I want to see:
008 $951.23 $215.92 $198,301.22 009 $950.19 $216.95 $198,084.26 010 $949.15 $217.99 $197,866.27 011 $948.11 $219.04 $197,647.23
What other code should I see from my class that might help?
source share