由网友(回忆,求你放过我)分享简介:我需要解析字符串1.2345E-02(pssed指数符号一批EX $ P $)为十进制数据类型,但 Decimal.Parse(1.2345E-02 )简单地抛出一个错误I need to parse the string "1.2345E-02" (a number expressed in exponential...
我需要解析字符串1.2345E-02(pssed指数符号一批EX $ P $)为十进制数据类型,但 Decimal.Parse(1.2345E-02 )
简单地抛出一个错误
I need to parse the string "1.2345E-02" (a number expressed in exponential notation) to a decimal data type, but Decimal.Parse("1.2345E-02")
simply throws an error
推荐答案
这是一个浮点数,你必须告诉它:
It is a floating point number, you have to tell it that:
decimal d = Decimal.Parse("1.2345E-02", System.Globalization.NumberStyles.Float);
相关推荐
最新文章