Fixed right align with negative number

This commit is contained in:
Geir Okkenhaug Jerstad 2024-11-19 14:39:18 +01:00
parent 3cb41d15d7
commit 8c82e37a20

View file

@ -20,7 +20,7 @@ while (!string.IsNullOrWhiteSpace(text))
var character = (char)i;
var percentage = 100 * counts[i] / totalLetters ;
// string output = counts[i] + " - " + character + " - " + percentage + "%";
Console.WriteLine(String.Format("{0,0} - {1,1} - {2,2}%", counts[i], character, percentage));
Console.WriteLine(String.Format("{0,-3} - {1,1} - {2,2}%", counts[i], character, percentage));
}
}
}