double paintneeded = area/450;
When I run the above, I get the output as 0.444444444
, but I wanted only 0.44
.
I tried this, but it throws an error:
double paintneeded = String.Format("{0:0.00}", (area/450));
Console.WriteLine("Number of Gallons paint needed:\t{0}", paintneeded);
How do I use String.Format
in this expression? Or can I use it in the Console.WriteLine
? If so, how do I implement it?