Wrong result from IsNumeric() in VB.NET

后端 未结 1 595
耶瑟儿~
耶瑟儿~ 2021-01-27 01:28

I have a function in VB.NET that loops through values and attempts to convert it to a decimal if IsNumeric is True,

Dim Value As String

If IsNumeri         


        
相关标签:
1条回答
  • 2021-01-27 02:16

    See http://support.microsoft.com/kb/329488

    IsNumeric returns true if it can be converted to a double which is true for 603E43 The value is however larger than what a decimal can hold

    You could use the Decimal.TryParse funcion as a working alternative. See http://msdn.microsoft.com/en-us/library/9zbda557.aspx

    0 讨论(0)
提交回复
热议问题