如何通过十进制数在文本框中显示值以在另一个文本框中生成结果 [英] How Do I Mutiply A Value In A Textbox By A Decimal Number To Produce The Results In Another Textbox
本文介绍了如何通过十进制数在文本框中显示值以在另一个文本框中生成结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试过这个,但答案是错的
AFTotal.Text = Val(TotalCashEmoluments.Text)* Val(0.05)
请帮帮我,我要去哪里使用decimal.TryParse将文本转换为小数
https://msdn.microsoft.com/en-us/library/system.decimal .tryparse(v = vs.110).aspx [ ^ ]
然后使用decimal.Multiply将它们相乘
https:/ /msdn.microsoft.com/en-us/library/system.decimal.multiply(v=vs.110).aspx [ ^ ]
i have tried this but the answer is wrong
AFTotal.Text = Val(TotalCashEmoluments.Text) * Val(0.05)
please help me where am i going wrong
解决方案
Use decimal.TryParse to convert the text to decimals
https://msdn.microsoft.com/en-us/library/system.decimal.tryparse(v=vs.110).aspx[^]
Then use decimal.Multiply to multiply them
https://msdn.microsoft.com/en-us/library/system.decimal.multiply(v=vs.110).aspx[^]
这篇关于如何通过十进制数在文本框中显示值以在另一个文本框中生成结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文