Click to See Complete Forum and Search --> : converting problems


freek
July 19th, 1999, 05:30 AM
I need to convert a string into double to use it in a search expression.
The problem is that I must use the European settings (, as decimal symbol) and VB uses always the VS settings. But if I try to convert the string to double (with cdbl() ) he uses the European settings ("41,2" is converted to 41,2 and not 41.2), which gives an error in the search string ( comma in expression).

Can anyone help me with this?

Pasi Salminen
July 19th, 1999, 06:50 AM
Hi!

I have solved this problem with following code:


dim myStr$, myPos%
myStr = "12,3" 'This is your number
myPos = Instr(1,myStr,",")
mid(myStr,myPos,1) = "." 'This converts "," to "."
'Now myStr is "12.3"




Pasi Salminen
pasisalminen@hotmail.com