Name: Anonymous 2013-02-03 4:44
How can I pad a double with both trailing zeros (two places, for money) and leading spaces before the $ to align the decimal places?
I want my list to look like:
$###.##
$###.##
_$##.##
__$#.##
__$0.##
__$0.00
As the value decreases. The underscores should be spaces, of course. I wasn't sure if they would appear or be deleted in the post.
Also, I changed a function somewhere and a series of print functions decided to start tabbing every fucking word so they're all spread out and I can't find anything wrong with the code. Any ideas?
System.out.print("\n\nWhat would you like to do?\n1. Calculate the Monthly Payment for a fixed rate, fixed term loan.\n");
System.out.print("2. Calculate the number of Months to pay off a loan with a fixed monthly payment.\n");
System.out.print("\nPlease enter the number of your selection: ");
I want my list to look like:
$###.##
$###.##
_$##.##
__$#.##
__$0.##
__$0.00
As the value decreases. The underscores should be spaces, of course. I wasn't sure if they would appear or be deleted in the post.
Also, I changed a function somewhere and a series of print functions decided to start tabbing every fucking word so they're all spread out and I can't find anything wrong with the code. Any ideas?
System.out.print("\n\nWhat would you like to do?\n1. Calculate the Monthly Payment for a fixed rate, fixed term loan.\n");
System.out.print("2. Calculate the number of Months to pay off a loan with a fixed monthly payment.\n");
System.out.print("\nPlease enter the number of your selection: ");