Преглед на файлове

2004-06-18 Sebastien Pouliot <[email protected]>

	* SqlMoney.cs: Removed old "hack" to correct scale after rounding as
	Decimal has been fixed (in fact this code was moved and adapted for
	Decimal as it was better than the previous fix).

svn path=/trunk/mcs/; revision=29802
Sebastien Pouliot преди 21 години
родител
ревизия
29cb77e547
променени са 2 файла, в които са добавени 7 реда и са изтрити 17 реда
  1. 6 0
      mcs/class/System.Data/System.Data.SqlTypes/ChangeLog
  2. 1 17
      mcs/class/System.Data/System.Data.SqlTypes/SqlMoney.cs

+ 6 - 0
mcs/class/System.Data/System.Data.SqlTypes/ChangeLog

@@ -1,3 +1,9 @@
+2004-06-18  Sebastien Pouliot  <[email protected]>
+
+	* SqlMoney.cs: Removed old "hack" to correct scale after rounding as
+	Decimal has been fixed (in fact this code was moved and adapted for
+	Decimal as it was better than the previous fix).
+
 2004-06-08 Umadevi S <[email protected]>
 	* SqlGuid.cs - fixed bug 59420. Implemented CompareTo according to MSDN documenation
 

+ 1 - 17
mcs/class/System.Data/System.Data.SqlTypes/SqlMoney.cs

@@ -57,23 +57,7 @@ namespace System.Data.SqlTypes
 		{
 			if (value > 922337203685477.5807m || value < -922337203685477.5808m)
 				throw new OverflowException ();
-
-			value = Decimal.Round (value, 4);
-
-			int [] bits = Decimal.GetBits (value);
-			int scaleDiff = 4 - ((bits [3] & 0x7FFF0000) >> 16);
-			decimal tmp = value;
-			// integrify
-			if (scaleDiff > 0)
-				for (int i = 0; i < scaleDiff; i++)
-					tmp *= 10;
-			else if (scaleDiff < 0)
-				for (int i = 0; i > scaleDiff; i--)
-					tmp /= 10;
-			int [] tmpbits = decimal.GetBits (tmp);
-			tmpbits [3] = (value < 0) ? 0x8004 << 16 : 0x40000;
-			this.value = new decimal (tmpbits);
-
+			this.value = Decimal.Round (value, 4);
 			notNull = true;
 		}