Are there any options for setting the default format when writing a double
value to the console?
I have many double
values to output to the console, and I need set the format to two decimal places on all of them, like Math.Round(number, 2)
.
Can I set this for all of them?
Right now I'm using:
Console.WriteLine("{0} x {1} x {2}",
Math.Round(a, 2), Math.Round(b, 2), Math.Round(c, 2));