I have seen plenty of questions on how to round to two decimal places using Math.Round()
, but not when using placeholders. This is my best attempt but the program is still giving me around 14 decimal places:
Console.Write("\n\nPercentatge Weight: {0}% ",
G[ArrayCount] * 100 / RayTotal,
Math.Round(RayTotal, 2));
After this runs I am getting a percentage such as 14.3256941565
.
I just want it to be 14.33
Should add that I don't already have the value it is dependent on what the user enters.