Skip to main content
Microsoft Silverlight
Home Forums General Silverlight Programming Programming with .NET - General Problem with assigning calculated double values to Point
10 replies. Latest Post by N.Tony on July 26, 2007.
(1)
rabinovic
Member
20 points
6 Posts
05-24-2007 7:20 AM |
I have the following problem:
ArcSegment
double y = -
arcSeg.Point =
Well x = 49,7502082639013 and y -4,99167083234141
But arcSeg.Point is not (49.75, -4.99) what i get is (49, 7502086390)
I have the same problem when i use lineSegments
Here is what i mean: http://www.bilder-hosting.de/show/CEZ6Y.html
jm47
26 points
11 Posts
05-25-2007 3:35 AM |
Can you paste the XAML? When I use the following code (similar except the control is created in C# instead of in xaml), the point is correct:
05-25-2007 7:03 AM |
I have copied your code. after running i get the output: 49,7502082605056. In a WPF application the Point is correct, but in a Silverlight application It is still not correct
bobrob
28 points
19 Posts
05-28-2007 3:21 AM |
Read http://silverlight.net/forums/t/1412.aspx
Same bug in my opinion. Tragic bug! All floating point coordinates fail for Europeen Silverlight clients.
05-28-2007 4:04 AM |
I think have the answer (10x bobrob):
Well i set the current culture to something like English Canada and this works:
{
System.Threading.
} catch { }
// Required to initialize variables
InitializeComponent();
}
I get the right values in arg.Point!
Thanks!
05-29-2007 5:20 AM |
It does not work for me, I get the exception:
Attempt to access the method failed: System.Threading.Thread.set_CurrentCulture(System.Globalization.CultureInfo)
Even if ignored, the culture is not changed:
double d= 34.12;string str1= d.ToString(); // "34,12"try { System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-CA"); }catch {} string str2= d.ToString(); // "34,12"
...and drawing operations are erroneous.
05-29-2007 8:10 AM |
try to change the current language of your operating system to english (in the system control).
I think this will solve the problem.
luisabreu
Participant
1676 points
612 Posts
05-29-2007 8:54 AM |
hello.
rabinovic:System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-CA");
i believe this won't work because the CurrentCulture set is annotated with the SecurityCritical code (which means it can only be aclled by platform code).
05-29-2007 9:43 AM |
you are right.
I found that this part of code doesn't make any change. As i have mentioned in the previous post i changed the current language of my winXp to english in the system control. Now it works.
seemar
154 points
42 Posts
06-04-2007 7:06 PM |
We have noted the bug and it is now in our silverlight bug database. Thank you for reporting!
-SeemaR@MS
N.Tony
36 points
07-26-2007 10:38 AM |
I have the same problem (my Regional options is Russian).
To work around this problem I change "Standarts and Formats" options to "English(United States)" (at Control Panel -> Regional and Language Options)