Results 1 to 4 of 4

Thread: ** RESOLVED ** How can I tell if a number has a decimal point in it ?

  1. #1

    Thread Starter
    Frenzied Member TheBionicOrange's Avatar
    Join Date
    Apr 2001
    Location
    Cardiff, UK
    Posts
    1,818

    ** RESOLVED ** How can I tell if a number has a decimal point in it ?

    Is there a quick way to see if a number contains a decimal point ?

    The quicker the method the better as I will be doing a LOT of checking !

    Cheers.
    Last edited by TheBionicOrange; Feb 28th, 2002 at 07:13 AM.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    VB Code:
    1. Private Function IsDecimal(ByVal oValue As Variant) As Boolean
    2.     Dim sValue As String
    3.     sValue = CStr(oValue)    
    4.     IsDecimal = False
    5. ' Should really do extra checking here for the decimal speficier determined
    6. ' from the Locale API routines
    7.     If IsNumeric(sValue) Then
    8.         If InStr(1, oValue, ".") Then
    9.             IsDecimal = True
    10.         End If
    11.     End If
    12. End Function

  3. #3
    Frenzied Member oh1mie's Avatar
    Join Date
    Sep 2001
    Location
    Finland
    Posts
    1,043
    Code:
    IF int(MyNumber)<>MyNumber Then
       'it have a desimalpoint
    End if
    oh1mie/Vic


  4. #4

    Thread Starter
    Frenzied Member TheBionicOrange's Avatar
    Join Date
    Apr 2001
    Location
    Cardiff, UK
    Posts
    1,818
    Cheers Guys

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width