I have this program that displays the cost per gallon of gasoline.
System.out.printf("%10s %.2f %s %n", "At", cost , "per gallon,");
The output displays
At 5.12 per gallon,
but I want it to display
At $5.12 per gallon,
I have tried to add the $ right after "At" but it displays a space before showing the cost. Is there a way to remove the space between "$