Dim strnumber
strnumber = \"0.3\"
Dim add
add = 0.1
Dim result
result = strnumber + add
MsgBox result
I want to get 0.4
as result, b
Has to do with your locale settings. Automatic conversion (as well as explicit one) observes it in the same manner as in CStr()
function.
E.g. in my locale CStr( 0.3)
results to 0,3
that is invert to CDbl("0,3")
while CDbl("0.3")
results to an error.
BTW: always use option explicit
and, for debugging purposes, On Error Goto 0