Thank you so much!
It worked.
If anyone else has this problem, this is what I changed:
String.Format(" {0:#.00}", Math.Round(i + HighGrade, 2, MidpointRoundin g.AwayFromZero) ).PadLeft(4)
After String.Format use this "{0:#.00}" and replace the number of 0's after the decimal to what you need.
User Profile
Collapse
-
Math.Round does not always show two decimal places
I'm writing a program in vb.net 2008 that calculates grades and puts them in a list. When I use Math.Round it will not show two decimal places for a number without decimals. For example:
This is what I have
100
96.97
93.94
...
Is there a way to force 100 or any other number that does not have decimals to have .00 after it?
Here is what I'm using in my code now
...
No activity results to display
Show More
Leave a comment: