i have an access database with a price column as text type i want to convert it to double to do some comparisons the problem is the column has values that looks like the following:
5.22
2.5$
62.5
34.6$
45.3
65.9$
so Convert.ToDouble is working fine with the values that does not contain the “$” sign so how can i remove the $ sign from the text before converting it to double?
so basicly the idea is
check if there is “$”
remove “$” from text
covert to double…
also it would be better to delete anything from the number except the decimal point
You can use
String.Replace. No need to check for “$”. If it is there, it will be replaced.