How to check/validate whether the value is a whole number in C#?

Discussion in 'ASP .Net Web Controls' started by Siew Yee, Aug 12, 2005.

  1. Siew Yee

    Siew Yee Guest

    Hi,

    Does C# has a method to check whether the value is a whole number?
    Thanks.

    Regards,
    Siew Yee
     
    Siew Yee, Aug 12, 2005
    #1
    1. Advertisements

  2. Siew Yee

    clintonG Guest

    One approach would use the mod operator and check for a returned value of
    zero.


    <%= Clinton Gallagher
    METROmilwaukee (sm) "A Regional Information Service"
    NET csgallagher AT metromilwaukee.com
    URL http://metromilwaukee.com/
    URL http://clintongallagher.metromilwaukee.com/


    "Siew Yee" <> wrote in message
    news:...
    > Hi,
    >
    > Does C# has a method to check whether the value is a whole number?
    > Thanks.
    >
    > Regards,
    > Siew Yee
     
    clintonG, Aug 13, 2005
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Reddy
    Replies:
    2
    Views:
    532
    Reddy
    Jan 23, 2004
  2. \A_Michigan_User\
    Replies:
    2
    Views:
    1,115
    \A_Michigan_User\
    Aug 21, 2006
  3. David Marsh

    testing whether a double is a whole number

    David Marsh, Jul 3, 2005, in forum: C Programming
    Replies:
    3
    Views:
    723
    David Marsh
    Jul 3, 2005
  4. Matthias
    Replies:
    6
    Views:
    494
    Matthias
    Nov 14, 2008
  5. Kuhl
    Replies:
    37
    Views:
    2,185
    Keith Thompson
    Apr 20, 2009
  6. JB
    Replies:
    1
    Views:
    697
  7. PerlFAQ Server
    Replies:
    0
    Views:
    224
    PerlFAQ Server
    Jan 30, 2011
  8. PerlFAQ Server
    Replies:
    0
    Views:
    165
    PerlFAQ Server
    Mar 30, 2011
Loading...