Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List of tuple<double,double>. Comma instead of point in double values

The situation: I have a list of tuple, in which a tuple is added:

List<Tuple<double, double>> list = new List<Tuple<double, double>>();
list .Add(new Tuple<double, double>(2.2, 6.6));

All seems to be ok. But... In Debugging mode, in the list of local vars I see next:

[0] {(2,2, 6,6)}    System.Tuple<double,double>

By the way, the backword action working good:

double t = list[0].Item1;

I got:

t   2.2 double

May be it's not a big problem, but it frustrates me.

Any ideas why so?

like image 502
MCv Avatar asked Dec 07 '25 02:12

MCv


2 Answers

Because the debugger shows numbers in your local (user) national format, so it shows them as 2,2 and 6,6 instead of 2.2 and 6.6 .

I know various work places that use English versions of OS and Visual Studio so not to have similar problems :-) This is clearly not necessary, because you can...

...change in the Control Panel (International Settings) the format of decimal numbers.

like image 55
xanatos Avatar answered Dec 08 '25 17:12

xanatos


That is because your local culture settings have the , as decimal separator. Whenever .NET tries to parse it to a string, it uses this to determine what separator to use.

You could change your regional / culture settings to English US. You will see the decimal separators are you'd expect them to be. If you don't want this, stop worrying about it.

like image 43
Patrick Hofman Avatar answered Dec 08 '25 16:12

Patrick Hofman