What's the proper way to convert from a scientific notation string such as "1.234567E-06" to a floating point variable using C#?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
Also consider using
This will ensure that
MyFloat
is set to value 0 if, for whatever reason, the conversion could not be performed. Or you could wrap theDouble.Parse()
example in aTry..Catch
block and setMyFloat
to a value of your choosing when an exception is detected.