Posts

Showing posts with the label formatting

Java formatting, how do I get a symbol to stick to an int?

Image
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(...

C# Curly Brace Formatting Visual Studio 2017

Image
Clash Royale CLAN TAG #URR8PPP C# Curly Brace Formatting Visual Studio 2017 I'm new to Visual Studio Code and I have moved there from Atom since I'm learning C#. This is also my first time posting a question here, so pardon me if I haven't done a good job. for(int i = 1; i < args.Length; i++){<cursor>} I want to be able to press enter and the code should look like: for(int i = 1; i < args.Length; i++) { <cursor> } I know other people have faced similar problems but I've researched for hours and fiddled around with the setting to no success. I am using Visual Studio 2017, latest version. Please ask questions if you need any more information. Thanks! Press enter after the ( and then type { and it will make {} press enter again and you will get the format you wanted – BugFinder 22 mins ago ...