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. Advertising

  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. Advertising

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. David Marsh

    testing whether a double is a whole number

    David Marsh, Jul 3, 2005, in forum: C Programming
    Replies:
    3
    Views:
    599
    David Marsh
    Jul 3, 2005
  2. Matthias
    Replies:
    6
    Views:
    373
    Matthias
    Nov 14, 2008
  3. JB
    Replies:
    1
    Views:
    542
  4. PerlFAQ Server
    Replies:
    0
    Views:
    125
    PerlFAQ Server
    Jan 30, 2011
  5. PerlFAQ Server
    Replies:
    0
    Views:
    92
    PerlFAQ Server
    Mar 30, 2011
Loading...

Share This Page