windsim <(E-Mail Removed)> wrote:
> I have a c# program where I need a numerical float input. Due to the
> culture difference, someone is used to type f.ex. 1,3; 2,32 (, comma) while
> others use 1.3; 2.32(. point) etc. so the program should accept both
> numerical expression.
> How can I do it?
Well, if you know the appropriate CultureInfo to use, pass it to
double.TryParse as the format provider. If you don't, could you just
replace all commas with points first? Note that that would cause a
problem if people start putting commas in for thousands, eg
1,234.45
--
Jon Skeet - <(E-Mail Removed)>
http://www.pobox.com/~skeet Blog:
http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too