![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, Does C# provide a method to check/validate whether the value is a whole number not? Thanks. Regards, Siew Yee |
#3
| |||
| |||
|
|
"Siew Yee" <SiewYee (AT) discussions (DOT) microsoft.com> wrote in message news:E2563ABC-B3F6-4C42-8586-F00E48627B10 (AT) microsoft (DOT) com... Hi, Does C# provide a method to check/validate whether the value is a whole number not? Thanks. Regards, Siew Yee Reaseach the .NET Framework Convert class. If, for example, you were to use the Convert.ToInt32 method in a try - catch block, any attempt to convert an argument that is not an integer will throw an exception and you can deal with it. -- Peter [MVP Visual Developer] Jack of all trades, master of none. |
#4
| |||
| |||
|
|
"Siew Yee" <SiewYee (AT) discussions (DOT) microsoft.com> wrote in message news:E2563ABC-B3F6-4C42-8586-F00E48627B10 (AT) microsoft (DOT) com... Hi, Does C# provide a method to check/validate whether the value is a whole number not? Thanks. Regards, Siew Yee Reaseach the .NET Framework Convert class. If, for example, you were to use the Convert.ToInt32 method in a try - catch block, any attempt to convert an argument that is not an integer will throw an exception and you can deal with it. |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |