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?
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
also, you can try CCur("$80.00")
Oops I meant Cint("$80.00")
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
x = FormatNumber("$80.50", 2) ' the 2 stands for nums after digit
MsgBox x