Web server running in Dutch(Belgium)
double output;
double.TryParse(txtTextbox1.Text, out output);
Is this a good way to convert text to double in dutch environment? Let’s say the input is “24.45” instead of “24,45“
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you want to use the Dutch (Belgium) number format:
Or to use the US number format:
If you attempt to parse “24.45” with a Dutch culture set, you’ll get back “2445”, similarly, if you attempt to parse “24,45” with a US culture, you’ll get “2445”. If you want the parse to fail if the wrong decimal point is used, change NumberStyles.Any to exclude the flag:
NumberStyles.AllowThousands:If your entire application is in Dutch, you should change your cultureinfo globally – here’s how to do it in WinForms and here’s how to do it in ASP.NET.
Once you’re using a globally set CultureInfo, you can change the above code to: