I am having a problem using Math.Round(). My program reads in a decimal from a windows form text box,converts this to a double. Then I am trying to round off the double to the nearest whole number. However this is not working it does not round off the number at all. Here is my code:
I am using visual c# 2008 express edition to build my program. Also is it possible to read in a number from the user in a windows form instead of using a Text Box and then converting to a double?
Thanks All, any help or suggestions would be great.
Even though Germany uses a comma instead of a decimal, it doesn't mean that it is always the correct answer. In the US, we use a decimal. So your example would fail if the current culture is the US.
Bookmarks