> Why ToString and Parse methods of Decimal type are not symmetric?
> I think this non symmetric design is a bad design because a
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
if you did specify the Format Type, then you are being symmetric, but as
it stands, you are using a custom format in one case and the default in
another. So technically the function is symmetric. Though the
Parse/ToString isn't completely symmetric (won't work with double, for
instance, instance because of rounding in the ToString function)
-akshay
===================================
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