VB.NET 将双精度值转换为字符串 = 精度损失
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22016718/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-17 16:53:49 来源:igfitidea点击:
VB.NET Converting Double Value to String = Precision loss
提问by user2776069
Hello I have a double value like this in VB.NET:
你好,我在 VB.NET 中有一个像这样的双值:
Dim value = 9.729000000000001
When converting to string, I get this:
转换为字符串时,我得到:
value.tostring() "9.729"
I try to add formatting:
我尝试添加格式:
value.tostring("0.00000000000000")
But it did not work (I lose the ending 1).
但它没有用(我失去了结局 1)。
How can I keep all of my digits?
我怎样才能保留我所有的数字?

