I had an unusual quirk in the program that I am writing, and I tried to find out if anyone knows the reason. Please note that the fixing problem is quite simple. I just can't understand why this is happening in the first place.
I have a WinForms program written in VB.NET that displays a subset of the data. It contains several labels that show numeric values (the .Textlabels property is assigned directly from decimal values). These numbers are returned by a DLL written by me in C #. The DLL calls the web service, which initially returns the values in question. It returns one as a string, the other as decimal (I have no control over the web service, I just consume it). The DLL assigns them to the properties of the object (both of which are decimal), and then returns this object back to the WinForm program that called the DLL. Obviously, there is a lot of other data from the web service, but no other operations occur, which can change these properties.
So, the short version:
- WinForm requests a new one
Foofrom the DLL. - The DLL creates the object
Foo. The DLL calls the webservice, which returns SomeOtherFoo.
Foo.Bar1 = decimal.Parse(SomeOtherFoo.Bar1);
Foo.Bar2 = SomeOtherFoo.Bar2;
The DLL returns Foo to WinForm.
WinForm.lblMockLabelName1.Text = Foo.Bar1
WinForm.lblMockLabelName2.Text = Foo.Bar2
So what is a fad?
WinForm.lblMockLabelName1.Text is displayed as "2.9000" , while WinForm.lblMockLabelname2.Text is displayed as "2.9" .
, # VB, , , , .ToString(), . , decimal.Parse(someDecimalString).ToString() - . , , , ( , ... ).
, , . , , .