本文介绍了误差总和。我该怎么办呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
i67.tinypic/5kfyo0.jpg
如何解决这笔款项。 1 + 2 = 12不是3.这是我的代码vb
Private Sub btnHitung_Click(sender as Object,e As EventArgs)处理btnHitung 。点击 txtJumlahB.Text =(txtStokSisa.Text + txtBarangM.Text)结束子谢谢 我尝试过: i try sum来自谷歌搜索。但我找不到相同的错误。
解决方案TextBox始终返回字符串,从不返回整数。字符串1与整数不一样,1。 您将两个字符串连接在一起,1+2= 12。 您必须将字符串转换为整数才能将它们组合在一起。查看 Integer.TryParse() [ ^ ]来实现这一目标。 i67.tinypic/5kfyo0.jpg
How can i fix that sum. 1+2 = 12 not 3. This my code vb
Private Sub btnHitung_Click(sender As Object, e As EventArgs) Handles btnHitung.Click txtJumlahB.Text = (txtStokSisa.Text + txtBarangM.Text) End Subthanks before What I have tried: i try sum from google search. but i can't find the same wrong with this.
解决方案 TextBox's always return strings, never integers. A string, "1", is not the same as an integer, 1. You're concatenating two strings together, "1" + "2" = "12". You have to convert the string to integers in order to add them together. Look into Integer.TryParse()[^] to accomplish that.更多推荐
误差总和。我该怎么办呢?
发布评论