c#分割操作不起作用 [英] c# Divide operation Not working
本文介绍了c#分割操作不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我在下面进行数学运算时,我没有收到小数点。
When I do this math below, I do not receive the decimal point.
string test =(2456/1000 ).T.S.String();
string test = (2456 / 1000).To.String();
我得到2而不是2.456。我该如何解决这个问题。答案假设为2.456。有人可以帮助我。
I get 2 instead of 2.456. How can I fix this issue. The answer suppose to be 2.456. Can someone assist me.
pianoboyCoder
pianoboyCoder
推荐答案
请尝试以下代码
Try below code
string test = ((double)2456 / 1000).To.String();
您还可以参考以下链接
https://www.dotnetperls.com/divide
https://www.dotnetperls.com/divide
>
这篇关于c#分割操作不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文