Conversion

  • Thread starter Thread starter scorpion53061
  • Start date Start date
S

scorpion53061

"selectedprice" exists as a string

$5.23 for instance

in this statement I need to convert it to double

CDbl(selectedprice)

how can I do this? It throws an invlaid cast exception.
 
Remove the dollar sign

OHM
"selectedprice" exists as a string

$5.23 for instance

in this statement I need to convert it to double

CDbl(selectedprice)

how can I do this? It throws an invlaid cast exception.
 
* "scorpion53061 said:
"selectedprice" exists as a string

$5.23 for instance

in this statement I need to convert it to double

CDbl(selectedprice)

how can I do this? It throws an invlaid cast exception.

Try something like that:

\\\
Dim d As Double = Double.Parse("$5.12", Globalization.NumberStyles.AllowCurrencySymbol)
///
 
That does not work for me. !

OHM
Try something like that:

\\\
Dim d As Double = Double.Parse("$5.12",
Globalization.NumberStyles.AllowCurrencySymbol) ///
 
Turns out after I removed any conversions and formatting the "$5.12"
converted to double fine without any intervention

I guess sometimes I make things more complicated than they have to be :(
 
post ur final code pls !
Turns out after I removed any conversions and formatting the "$5.12"
converted to double fine without any intervention

I guess sometimes I make things more complicated than they have to be
:(
 
Back
Top