In my application I get a number 2.424242E+08 in my label called lbl_price and when i try to convert it to a decimal i get a FormatEception. How can i fix this?
decimal newVat = Convert.ToDecimal(lbl_price.text);
In my application I get a number 2.424242E+08 in my label called lbl_price and when i try to convert it to a decimal i get a FormatEception. How can i fix this?
decimal newVat = Convert.ToDecimal(lbl_price.text);
Try:
decimal newVat = decimal.Parse(lbl_price.text, System.Globalization.NumberStyles.Float);