int.Parse and NumberStyles.AllowParentheses

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

*********************************************
Think outside the box!
*********************************************
 
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
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top