Need to get the decimal part of a number

Discussion in 'ASP General' started by Ricardo, Jun 30, 2003.

  1. Ricardo

    Ricardo Guest

    Hi.

    How can I -from an ASP page- get the decimal part of a
    number ?

    Thanks in advance for all your help.
     
    Ricardo, Jun 30, 2003
    #1
    1. Advertisements

  2. Ricardo

    Ray at Guest

    DecimalPart = CDbl(TheNumber)-CLng(TheNumber)

    If you don't care about the sign stick Abs() around the result. And I'm
    assuming you want the decimal value, i.e. if the number is 2, you want .0 as
    a result.

    Ray at home
     
    Ray at, Jun 30, 2003
    #2
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.