diff options
author | Sebastien Pouliot <sebastien@ximian.com> | 2004-06-17 22:46:45 +0400 |
---|---|---|
committer | Sebastien Pouliot <sebastien@ximian.com> | 2004-06-17 22:46:45 +0400 |
commit | 29cb77e5473cea75090fa9c8d5e763eeff07b5f7 (patch) | |
tree | da60db5fbc9141e05c104424a714fb4b63539691 /mcs | |
parent | 68419f70e132632f8d63471dbcb39cb7fb5656a3 (diff) |
2004-06-18 Sebastien Pouliot <sebastien@ximian.com>
* 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
Diffstat (limited to 'mcs')
-rw-r--r-- | mcs/class/System.Data/System.Data.SqlTypes/ChangeLog | 6 | ||||
-rw-r--r-- | mcs/class/System.Data/System.Data.SqlTypes/SqlMoney.cs | 18 |
2 files changed, 7 insertions, 17 deletions
diff --git a/mcs/class/System.Data/System.Data.SqlTypes/ChangeLog b/mcs/class/System.Data/System.Data.SqlTypes/ChangeLog index d8c54ca7b65..795093950e9 100644 --- a/mcs/class/System.Data/System.Data.SqlTypes/ChangeLog +++ b/mcs/class/System.Data/System.Data.SqlTypes/ChangeLog @@ -1,3 +1,9 @@ +2004-06-18 Sebastien Pouliot <sebastien@ximian.com> + + * 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 <sumadevi@novell.com> * SqlGuid.cs - fixed bug 59420. Implemented CompareTo according to MSDN documenation diff --git a/mcs/class/System.Data/System.Data.SqlTypes/SqlMoney.cs b/mcs/class/System.Data/System.Data.SqlTypes/SqlMoney.cs index ce203d752df..b92a09612ec 100644 --- a/mcs/class/System.Data/System.Data.SqlTypes/SqlMoney.cs +++ b/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; } |