且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

输入的字符串格式不正确-为什么我得到这个?

更新时间:2023-11-08 10:26:10

附加调试器,您将发现某些参数不是正确的浮点值" .

您应该使用 TryParse [
Attach a debugger and you will find that some of your parameters isn''t a correct float value.

You should use TryParse[^] if you are not sure about that the inputs are validated.

Hope this helps!


这部分将始终抛出异常:Convert.ToDecimal("0.3f"). 0.3f 是编译器可以识别的,但不应在代码中使用.其他内容似乎还可以.
This part will always throw an exception: Convert.ToDecimal("0.3f"). The 0.3f is something the compiler recognizes, but should not be used in the code.Other stuff seems to be ok.