stratisproject / Breeze

Project Breeze Repository
MIT License
88 stars 47 forks source link

[Priority: Medium] Investigate Money.ToString() API calls. #214

Closed nopara73 closed 7 years ago

nopara73 commented 7 years ago

In Hungarian system environment 3.2.ToString() results in 3,2, while in most other environments it results in 3.2. This can lead to unexpected issues.

nopara73 commented 7 years ago

It will not lead to unexpected issues. NBitcoin properly handles it. Test code:

Money m = new Money(1);
double n = 1.1;
Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
Console.WriteLine(n);
Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("tr-TR");
Console.WriteLine(n);

Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
Console.WriteLine(m);
Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("tr-TR");
Console.WriteLine(m);
Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
Console.WriteLine(m.ToString());
Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("tr-TR");
Console.WriteLine(m.ToString());

Console.ReadKey();

Output:

1.1
1,1
1
1
0.00000001
0.00000001