Results 1 to 3 of 3

Thread: Convert string "£1.23" to val (123 or 1.23) - How?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2000
    Location
    London
    Posts
    290
    dim mystr as string
    mystr = "£1.23"

    val(mystr) = 0

    so how to i get to 123 or 1.23?
    Are there any functions to do this or do i have to do it myself?

    Thanks,
    alex.

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2000
    Location
    London
    Posts
    290
    Thanks - i`m off home for the weekend, so i`ll either check it out then, or monday. It could also be in the form

    "£1,234,567.89" but maybe val doesnt mind commas.

    Didnt think of that though - i`m imagined some function which only takes numeric chars into account! Doh!

    Thanks again,
    alex

  3. #3
    Junior Member SysAdmin2's Avatar
    Join Date
    Mar 2000
    Location
    Plainfield, IL, USA
    Posts
    26

    Exclamation Try this

    Why not just do this:

    mystr = right(mystr, len(mystr)-1))


    Don't even use Val.

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