De-Format Currency in C#
c#
Solution
You can do the following instead:
string text = Price.Text; // Price.Text = "$31.07"
Single value = Single.Parse(text, NumberStyles.Currency);
Problem
I have a string value coming from a label in the .aspx page as following. ``` string text = Price.Text; // Price.Text = "$31.07" Single value = Convert.ToSingle(text); //throws FormatException ``` I can replace the $ sign with the empty text and then Convert to Single but I was wondering if there is better way to de-format the text with the '$' sign into a Single.