PDA

Click to See Complete Forum and Search --> : Convert string "£1.23" to val (123 or 1.23) - How?


Pallex
Aug 4th, 2000, 06:09 AM
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.

Pallex
Aug 4th, 2000, 12:57 PM
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

SysAdmin2
Aug 4th, 2000, 01:31 PM
Why not just do this:

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


Don't even use Val.