Java formatting, how do I get a symbol to stick to an int?
Clash Royale CLAN TAG #URR8PPP Java formatting, how do I get a symbol to stick to an int? I'm trying to print out a metric to imperial table and the format needs to be very specific. Using the format string : System.out.printf("%-2d%-1s|",counter++,"'"); I get the output: "1 '|" I need it to be: "1' |" Many thanks System.out.printf("%d%-1s|", counter++, "'"); ...? – Reimeus 6 mins ago System.out.printf("%d%-1s|", counter++, "'"); System.out.printf("%2d%-1s|", 1,"'"); ? – Debmalya Biswas 5 mins ago System.out.printf(...