Avatar of ITMax87
Flag for Canada

asked on 

Convert currency value from a textbox to Double

I have a textbox which hold a currency value like that :

Double total = 198.99;
txt_total.Text = decimal.Parse(total.ToString()).ToString("C"); // It displays "198.99 $"

that works fine at display but when I try to convert back the value to use it insome calculation It throws an exception (Input string was not in a correct format)

Double total = Double.Parse(txt_total.Text);

Thanks for your help

Avatar of undefined
Last Comment

8/22/2022 - Mon