[Mono-list] Decimal bug
Daniel Morgan
danmorg@sc.rr.com
Wed, 8 May 2002 12:14:21 -0400
This is a multi-part message in MIME format.
------=_NextPart_000_0017_01C1F689.E2B0BAF0
Content-Type: text/plain;
charset="US-ASCII"
Content-Transfer-Encoding: 7bit
Here is test case that shows an exception thrown formatting a Decimal.
It works fine in MS.NET, but not in mono.
------=_NextPart_000_0017_01C1F689.E2B0BAF0
Content-Type: text/plain;
name="DecimalTest.cs"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="DecimalTest.cs"
=0A=
using System;=0A=
=0A=
namespace TestDecimal {=0A=
=0A=
class DecimalTest {=0A=
=0A=
[STAThread]
static void Main(string[] args)
{
String str =3D "524001.5000000000";
Object obj;
obj =3D (object) Decimal.Parse(str);
Console.WriteLine(obj);
}=0A=
}=0A=
}=0A=
=0A=
/*=0A=
Microsoft .NET Results:=0A=
$ DecimalTest.exe
524001.5
=20
$ mono DecimalTest.exe
(process:692): ** WARNING **: unhandled exception =
System.ArgumentException: "len
gth"
in System.Array:Copy ()
in System.Text.StringBuilder:Remove ()
in System.DecimalFormatter:FormatGeneral ()
in System.DecimalFormatter:NumberToString ()
in System.Decimal:ToString ()
in System.Decimal:ToString ()
in System.IO.TextWriter:Write ()
in TestDecimal.DecimalTest:Main ()
=20
*/
------=_NextPart_000_0017_01C1F689.E2B0BAF0--