0
trying to write code for a function using dollar amounts with an operation only want 2 decimal places to show on output
4 odpowiedzi
0
Get a look to this page. It should solve your problem. https://msdn.microsoft.com/en-us/library/dwhawy9k(v=vs.110).aspx
0
will do thx
0
decimal account = 1500.955M;
Console.WriteLine("{0}", account.ToString("C2"));
And please use decimal for currency calculations because it's based by 10 not by 2. It has some advantages.
0
also multiplying it by a double decimal for a percentage