Results 1 to 3 of 3

Thread: Convert currency to double

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2011
    Posts
    132

    Convert currency to double

    I have a value $17.50 as a string

    how would i convert it to a double 17.50?

  2. #2
    Hyperactive Member
    Join Date
    Apr 2011
    Location
    England
    Posts
    421

    Re: Convert currency to double

    Assuming that your computers default currency is $ then this would work:

    VB Code:
    1. Dim str As String = "$17.50"
    2.  
    3. Dim dbl As Double = Double.Parse(str, Globalization.NumberStyles.Currency)
    4. MsgBox(Format(dbl, "0.00"))

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Mar 2011
    Posts
    132

    Re: Convert currency to double

    thank you

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