-1

我试过了:

MessageBox.Show(System.Numerics.BigInteger.Parse("7.56e+011",
          NumberStyles.Float,
          CultureInfo.InvariantCulture));

但它继续显示 7.56e+011

4

3 回答 3

4

您正在寻找格式化数字。你可以String.Format这样做

string.Format("{0:F}",System.Numerics.BigInteger.Parse("7.56e+011",
          NumberStyles.Float,
          CultureInfo.InvariantCulture))

运行以下代码

VS2012中的代码

为您提供以下 MessageBox

带字符串的消息框

{0:F0}您可以通过将其更改为格式来指定无小数点。

于 2013-10-31T15:13:23.797 回答
0
    decimal dec = decimal.Parse("7.7583877127496407E-6", 
    System.Globalization.NumberStyles.Any);
    Console.WriteLine(dec);
于 2013-10-31T15:12:26.737 回答
0

尝试

BigInteger num = System.Numerics.BigInteger.Parse("7.56e+011",
      NumberStyles.Float,
      CultureInfo.InvariantCulture);

String text = num.ToString("F5"); // New format string, here with 5 digits. 

您的解决方案再次从 BigInteger 隐式转换回字符串,如果指数很大,则使用科学记数法。

于 2013-10-31T15:12:42.307 回答