getting a whole number

Discussion in 'ASP General' started by le0, Aug 8, 2006.

  1. le0

    le0 Guest

    Hi Guys,

    Can you help me with this? Is there any function that I can use in getting a
    whole number

    Example:

    Input OutPut
    12.3 12
    1.63 1
    21.1 21

    Im using the function left(p1,p2) but it doesnt recognize the whole number

    Please help thanks =)
    le0, Aug 8, 2006
    #1
    1. Advertising

  2. le0

    Bobbo Guest

    le0 wrote:

    > Can you help me with this? Is there any function that I can use in getting a
    > whole number


    Look up the help topics for Round, CInt and FormatNumber and decide
    which is best for you to use -- it depends on what you're trying to
    achieve.
    Bobbo, Aug 8, 2006
    #2
    1. Advertising

  3. "Bobbo" <> wrote in message
    news:...
    >
    > le0 wrote:
    >
    > > Can you help me with this? Is there any function that I can use in

    getting a
    > > whole number

    >
    > Look up the help topics for Round, CInt and FormatNumber and decide
    > which is best for you to use -- it depends on what you're trying to
    > achieve.
    >


    None of the above. ;)

    Int is the function needed

    Eg.

    Int(1.62) = 1
    Anthony Jones, Aug 8, 2006
    #3
  4. le0

    Bobbo Guest

    Anthony Jones wrote:

    >
    > None of the above. ;)
    >
    > Int is the function needed
    >


    Thanks Anthony, I stand corrected!

    I -- incorrectly -- remembered that CInt behaved like that. Guess it's
    been too long since I've done classic ASP! :)
    Bobbo, Aug 8, 2006
    #4
  5. Anthony Jones wrote:
    > Int is the function needed
    >
    > Eg.
    >
    > Int(1.62) = 1


    Depending on the desired behavior for negative numbers, yes. Otherwise Fix()
    is the one.

    And since this is an ASP forum, not a VBScript one, it is worth noting that
    Math.floor() does the same as Int().



    --
    Dave Anderson

    Unsolicited commercial email will be read at a cost of $500 per message. Use
    of this email address implies consent to these terms.
    Dave Anderson, Aug 8, 2006
    #5
  6. le0

    Evertjan. Guest

    Dave Anderson wrote on 08 aug 2006 in
    microsoft.public.inetserver.asp.general:

    > Anthony Jones wrote:
    >> Int is the function needed
    >>
    >> Eg.
    >>
    >> Int(1.62) = 1

    >
    > Depending on the desired behavior for negative numbers, yes. Otherwise
    > Fix() is the one.
    >
    > And since this is an ASP forum, not a VBScript one, it is worth noting
    > that Math.floor() does the same as Int().


    ... if you are using j[ava]script as asp serverside language.


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Aug 9, 2006
    #6
  7. le0

    le0 Guest

    Thanks guys =)

    "le0" <> wrote in message
    news:%...
    > Hi Guys,
    >
    > Can you help me with this? Is there any function that I can use in getting
    > a whole number
    >
    > Example:
    >
    > Input OutPut
    > 12.3 12
    > 1.63 1
    > 21.1 21
    >
    > Im using the function left(p1,p2) but it doesnt recognize the whole number
    >
    > Please help thanks =)
    >
    >
    le0, Aug 10, 2006
    #7
    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. \A_Michigan_User\
    Replies:
    2
    Views:
    870
    \A_Michigan_User\
    Aug 21, 2006
  2. Don
    Replies:
    30
    Views:
    6,227
    murari garg
    Mar 4, 2007
  3. David Marsh

    testing whether a double is a whole number

    David Marsh, Jul 3, 2005, in forum: C Programming
    Replies:
    3
    Views:
    597
    David Marsh
    Jul 3, 2005
  4. Matthias
    Replies:
    6
    Views:
    373
    Matthias
    Nov 14, 2008
  5. Siew Yee
    Replies:
    1
    Views:
    135
    clintonG
    Aug 13, 2005
Loading...

Share This Page