Why double.TryParse(“0.0000”, out doubleValue) returns false ?

后端 未结 9 638
一个人的身影
一个人的身影 2021-02-03 20:38

I am trying to parse string \"0.0000\" with double.TryParse() but I have no idea why would it return false in this particular example. When I pass integer-like stri

9条回答
  •  醉酒成梦
    2021-02-03 21:05

    When this method returns, contains the double-precision floating-point number equivalent to the s parameter, if the conversion succeeded, or zero if the conversion failed.

    From the MSDN page for this method.

    http://msdn.microsoft.com/en-us/library/994c0zb1.aspx

    Zero goes in, zero comes out.

提交回复
热议问题