Aarghhhhh !!!我刚才问如何输入数字只是现在我有问题,当我插入大量的代码,如:在文本框中写入数字时出现奇怪的结果
tbNum.Text = Convert.ToString(double.Parse(tbPerc.Text));
数量是int
而不是double
。因此,我得到了5623而不是562,3。如果有帮助,我已将InputScope设置为数字。谢谢!!!
事实上,我在Convert.ToString方法中有一些计算,但这是不相关的,因为在双精度之间计算的返回值是双精度值。
所以你正在转换一个字符串到一个你转换为一个字符串的双?啊哈... – f2lollpll 2012-03-13 20:20:13
看看[http://stackoverflow.com/questions/105770/net-string-format-to-add-commas-in-thousands-place-for-a-number](http:/ /stackoverflow.com/questions/105770/net-string-format-to-add-commas-in-thousands-place-for-a-number) – 2012-03-13 20:31:18
你可以添加你正试图转换的样本价值? – Bryant 2012-03-13 21:24:31