Convert string "$0.67" to Number "0.67"
-
Hi I want to convert a string that is "$0.67" to number format("0.67") how i convert this. mainly i have a values with $ sign and i want to remove this $ from the string. Please suggest how i do this. Thanks Mitesh
~Khatri Mitesh khatrimitesh@hotmail.com Bikaner (Rajasthan) INDIA
-
Hi I want to convert a string that is "$0.67" to number format("0.67") how i convert this. mainly i have a values with $ sign and i want to remove this $ from the string. Please suggest how i do this. Thanks Mitesh
~Khatri Mitesh khatrimitesh@hotmail.com Bikaner (Rajasthan) INDIA
-
Hi I want to convert a string that is "$0.67" to number format("0.67") how i convert this. mainly i have a values with $ sign and i want to remove this $ from the string. Please suggest how i do this. Thanks Mitesh
~Khatri Mitesh khatrimitesh@hotmail.com Bikaner (Rajasthan) INDIA
The Replace method on the string class can replace the $ with an empty string. Then you can use double.TryParse.
Christian Graus Driven to the arms of OSX by Vista.
-
Hi I want to convert a string that is "$0.67" to number format("0.67") how i convert this. mainly i have a values with $ sign and i want to remove this $ from the string. Please suggest how i do this. Thanks Mitesh
~Khatri Mitesh khatrimitesh@hotmail.com Bikaner (Rajasthan) INDIA
Along with the other suggestions, you could try Double.Parse with the overload that takes a System.Globalization.NumberStyles and choose AllowCurrencySymbol. If you care about working for other currencies than just $, this may be your best bet.