Hi Miha,
Yes, it is not formatted but the decimal value still contains
information about how many decimal it was created with. I want to use
this information in the UI level, but I can't since 0.000 gets
transformed to 0 without the .000. All other decimal values keep the
information about decimal places except for 0.
Look at this example
Decimal dec1 = new Decimal( 0, 0, 0, false, 3 ); //0.000
Decimal dec2 = new Decimal( 3000, 0, 0, false, 3 ); //3.000
myRow["dec1"] = dec1;
myRow["dec2"] = dec2;
When looking at the flags property in quick watch:
dec1 has 196608, ie. 3 decimals
dec2 has 196608, ie. 3 decimals
myRow["dec1"] has 0, ie. 0 decimals !!!!
myRow["dec2"] has 196608, ie. 3 decimals
Miha Markic said:
Hi Carl,
Err, data in dataset is stored in native format and not formatted at all
(3.000 is stored as 3 and 0.000 is stored as 0).
Formating is supposed to happen at UI level (datagrid perhaps).
--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com
Carl G said:
I have a DataSet with a couple of tables. I have noticed that when I
am trying to store a Decimal 0.000 in a datarow, the value is changed
to 0, without the information about its decimalplaces.
Storing 3.000 works fine but not 0.000. Why is that?