Results 1 to 3 of 3

Thread: Number Question(Resolve Thanks[ Illspirit ] )

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2000
    Posts
    462

    Red face Number Question(Resolve Thanks[ Illspirit ] )

    If I have a number say 12,345.67 and I do a check of this number I get 12

    So My question is the a way to take out the comma easy other than creating a routine that does an instr to find the location of the comma and then do a left and right string in order to come up with the sum 12345.67.
    Last edited by Dbee; Oct 18th, 2002 at 01:06 PM.
    Don
    (OLD DOS Programmer)

  2. #2
    Fanatic Member Illspirit's Avatar
    Join Date
    Mar 2001
    Location
    Blackpool, England
    Posts
    815
    VB Code:
    1. Dim sIn As String, fOut As Double
    2. sIn = "123,456.789"
    3.  
    4. fOut = CDbl(Replace(sIn, ",", vbNullString, , , vbTextCompare))
    5.  
    6. MsgBox fOut
    Illspirit - [email protected]

    SmartBarXP Lead Developer
    SmartBarXP - The leading desktop sidebar application for Microsoft Windows XP

  3. #3
    New Member
    Join Date
    Oct 2002
    Location
    Montreal
    Posts
    2
    I'm not that experienced with VB, so I can't give you the exact code, but I'm pretty sure that the "format" function could format your number and take out the comma.

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