I can agree with you Gaurav and Robin but I think that there are two other
options that make ToString and Parse more symmetric:
1) do not accept "C" format for a Decimal, that is Decimal.ToString("C")
should throw a FormatException as it do for "R", "X", etc.
2) actually Decimal.Parse(string) implementation uses NumberStyles.Number
(that's 0x6F = 111), it should use NumberStyles.Number |
NumberStyles.AllowCurrencySymbol (that's 0x16F = 367).
IMHO I prefer solution n.1.
What you think? Why MS made a different design decision?
TIA (luKa)
On Tue, 2 Sep 2003 14:02:18 -0400, Gaurav Khanna <[EMAIL PROTECTED]> wrote:
>...But presumbly,
>passing a different number styles brings a lot of difference, considering
>that the default assumption of the style is that as a "Number" and not
>"Currency".
>
On Tue, 2 Sep 2003 13:04:31 -0500, Robin Debreuil <[EMAIL PROTECTED]> wrote:
>I would say making you specify all this is a better behaviour
>than 'best guess' in this case.
>
===================================
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