|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
int.Parse and NumberStyles.AllowParenthesesHi,
Just a quick question: How come that using int.Parse("(20), NumberStyles.AllowParenthesis" ); returns a negative value? I would definetly expect that call to return something positive. Thanks, Bernhard. If you look at standard numbering, in apps like Excel, negative numbers can
take one of the following formats: -20 (20) The same methodology has been put into .NET. -- Show quoteGregory A. Beamer MVP; MCP: +I, SE, SD, DBA http://gregorybeamer.spaces.live.com ********************************************* Think outside the box! ********************************************* "bernhard" <bernh***@discussions.microsoft.com> wrote in message news:1C993A9C-B769-4157-8A2E-71943C3F24AE@microsoft.com... > Hi, > > Just a quick question: How come that using int.Parse("(20), > NumberStyles.AllowParenthesis" ); returns a negative value? > > I would definetly expect that call to return something positive. > > Thanks, Bernhard. On Thu, 26 Apr 2007 04:46:01 -0700, bernhard wrote:
> Hi, Parenthesizing negative numbers is an accounting principle, that can be> > Just a quick question: How come that using int.Parse("(20), > NumberStyles.AllowParenthesis" ); returns a negative value? > > I would definetly expect that call to return something positive. > > Thanks, Bernhard. utilized in the .NET Framework This still does not make sense because you do not expect something general as
int.Parse()/NumberStyles.* to be accounting specific. But thanks for the explanation. I can now see where it originates from. Thanks, B. Show quote "Rad [Visual C# MVP]" wrote: > On Thu, 26 Apr 2007 04:46:01 -0700, bernhard wrote: > > > Hi, > > > > Just a quick question: How come that using int.Parse("(20), > > NumberStyles.AllowParenthesis" ); returns a negative value? > > > > I would definetly expect that call to return something positive. > > > > Thanks, Bernhard. > > Parenthesizing negative numbers is an accounting principle, that can be > utilized in the .NET Framework > -- > Bits.Bytes > http://bytes.thinkersroom.com > |
|||||||||||||||||||||||