We have web Application and user can be in different locations in europe.
Few Write number like this 5,5
and few Write like 5.5
in a textbox
We try to use that number like below
double priceOfITem = 0;
double.TryParse(((TextBox)tabTest.Rows[0].Cells[3].Controls[0]).Text.Replace(".", ","), out priceOfITem )
But this gives output as 55
which is totally wrong.
I tried like priceOfITem= Convert.ToDouble(string.Format(Thread.CurrentThread.CurrentCulture, "{0:#.##}",(((TextBox)tabTest.Rows[0].Cells[0].Controls[0]).Text)));
This Works if i type 5.5 and if i type 5,5 then it converts to 55.
Some users can type 5,5 and some can type 5.5 depending on coutry there are in. How to solve this in best manner?