Hi all,
I had a formula as follow :
Count/TotalCount
*100; // in percentwhereby count is an integer and TotalCount is a double.
My result is also a double.
How can I convert the result to 2 decimal places
Thanks
Hi all,
I had a formula as follow :
Count/TotalCount
*100; // in percentwhereby count is an integer and TotalCount is a double.
My result is also a double.
How can I convert the result to 2 decimal places
Thanks
Round to 2 decimal places
Ultrawhack
Double TotalCount = 7;
Double Output = Count / TotalCount * 100;
// Math.Round(value, decimals)
Console.WriteLine(Math.Round(Output, 2).ToString());