Link to home
Start Free TrialLog in
Avatar of LearningJava
LearningJava

asked on

String to number

Hi:
     Given the following string :

"$80.00"

I need to add this string to a number. I have tried using the Val function but I get a zero because of the dollar sign. Is there another function or procedure that I could use to covert the string to a number?

ASKER CERTIFIED SOLUTION
Avatar of mladenovicz
mladenovicz

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mladenovicz
mladenovicz

also, you can try CCur("$80.00")
Oops I meant Cint("$80.00")
Avatar of aelatik
You could use FormatNumber ( It will handle the decimals correctly that way )

x = FormatNumber("$80.50", 2) ' the 2 stands for nums after digit
MsgBox x