Click here to Skip to main content
15,901,666 members

Comments by lmoelleb (Top 92 by date)

lmoelleb 28-May-22 9:43am View    
Does not work is a useless description. What did you observe happening? what did you expect to be happening? What does the debugger show is happening. If you do not know how to use the debugger, you must learn that now (google Visual Studio debugger tutorial or similar). There is NOTHING more important to learn than how to use the debugger. From beginner to professional with decades of experience the debugger is the most essential tool to master.
lmoelleb 15-Feb-22 4:36am View    
Then divide by 1000 as that is how you convert kilos to ton. It is a unit conversion and has nothing to do with decimal separators so don't try to solve these two very unrelated topics as one "problem". Once you have the result you expect then use it as is (double, decimal, float) or - if you need it as a string - use ToString specifying format and cultureinfo again.
lmoelleb 15-Feb-22 4:09am View    
https://en.wikipedia.org/wiki/Decimal_separator contains a list of countries. I would expect UK to work though, so debug and check what is going on - and if it does not work, post a SINGLE line of code with your call to TryParse showing a hard coded CultureInfo name and input string!
lmoelleb 15-Feb-22 3:08am View    
It is one of the European formats. Not "the European" format. There is more than one country in Europe, and they don't all use the same format. That is why you have to tell it which country rules to use. Sure, if you are 100% sure this is the specific format used, you can just hard code any of the countries/languages that use the desired format - for example German. But don't for a second think doing this means "now it works in Europe". Unfortunately humans managed to make this complicated long before computers where invented.
lmoelleb 31-Jan-22 9:14am View    
Yes, it is easy and simple as long as you understand that it should NEVER EVER be used for real passwords.