On Jan 25, 8:54 am, Patrik Kruse
<PatrikKr...@discussions.microsoft.com> wrote:
> This line exectues with an exception:
>
[quoted text clipped - 3 lines]
>
> Is this an error in the framwork?
Not quite - it's a bug in how you're formatting it. If you call plain
ToString() there's no guarantee that that value can be parsed, or that
it will be parsed to exactly the same value. The "r" format string
(roundtrip) makes that guarantee, so the following works:
double d = double.Parse(double.MinValue.ToString("r"));
I agree it's counterintuitive, but look at the two strings produced
and you'll see why it happens.
Jon
Jon
Patrik Kruse - 25 Jan 2008 09:30 GMT
Thanks Jon,
it is really not intuitive, and I get the value from a SOAP request so the
generation of it is out of my control.
I guess I must hardcode the min value string to be able to recognise the
value received as MinValue (used as null) then... :(
/Patrik
> On Jan 25, 8:54 am, Patrik Kruse
> <PatrikKr...@discussions.microsoft.com> wrote:
[quoted text clipped - 19 lines]
>
> Jon