One possible solution would be (for MS) to add another overload of Decimal.Parse that 
takes two strings; the second one should be one of the "standard formats" and the 
overload would know what NumberStyles values should correspond.

At 03:15 PM 9/2/2003 -0400, Luca Minudel wrote
>I think it isn't symmetric.
>
>I mean, take a pool of programmers that just know the standard format
>characters ("C", "R", "X",...) - they can do ToString("C") and they know
>what it means - then count how many of them know about NumberStyles and
>IFromatProvider (probably less then 20%) - they can do Parse(s) but they
>cannot do Parse(s, NumberStyles.AllowCurrency). -
>This is what I mean for non symmetric.
>
>If Decimal.ToString(format) cannot use "C" format of if
>Decimal.Parse(string) implementation recognize a currency format, 100% of
>them will be able to do ToString and then do Parse back. This is what I mean
>for symmetric.
>
>Don't you agree?
>TIA (luKa)
>http://nullabletypes.sourceforge.net/
>
>On Tue, 2 Sep 2003 14:14:35 -0400, Akshay Arora <[EMAIL PROTECTED]> wrote:
>>But it is symmetric. You did:
>>        string s = d.ToString( "C" ); // specify a "C" instead of
>>default
>>and then you did
>>        Decimal r = Decimal.Parse( s ); // leave default, don't specify
>>Currency


J. Merrill / Analytical Software Corp

===================================
This list is hosted by DevelopMentor�  http://www.develop.com
NEW! ASP.NET courses you may be interested in:

2 Days of ASP.NET, 29 Sept 2003, in Redmond
http://www.develop.com/courses/2daspdotnet

Guerrilla ASP.NET, 13 Oct 2003, in Boston
http://www.develop.com/courses/gaspdotnet

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to