Matteo Granatiero Active Member Licensed User Longtime User Nov 26, 2018 #1 In practice I need to add (as a value not as text) a number (+1) to a number entered in an EditBox. I tried so "rough" Code: Copy EditText1.Text = "1" Dim s As String = EditText1.Text Msgbox (s + 1, "") [/ CODE] My problem is this, which unfortunately leaves me, in the msgbox, "2.0". ONLY I will use the "2" as a value, how can I do?
In practice I need to add (as a value not as text) a number (+1) to a number entered in an EditBox. I tried so "rough" Code: Copy EditText1.Text = "1" Dim s As String = EditText1.Text Msgbox (s + 1, "") [/ CODE] My problem is this, which unfortunately leaves me, in the msgbox, "2.0". ONLY I will use the "2" as a value, how can I do?
DonManfred Expert Licensed User Longtime User Nov 26, 2018 #2 Use numberformat to format a value. Upvote 0
Matteo Granatiero Active Member Licensed User Longtime User Nov 26, 2018 #3 DonManfred said: Use numberformat to format a value. Click to expand... where? Upvote 0
Matteo Granatiero Active Member Licensed User Longtime User Nov 26, 2018 #4 DonManfred said: Use numberformat to format a value. Click to expand... I solved using Code: Copy Dim p as Int = edittext1.text Upvote 0
DonManfred said: Use numberformat to format a value. Click to expand... I solved using Code: Copy Dim p as Int = edittext1.text
Erel B4X founder Staff member Licensed User Longtime User Nov 26, 2018 #5 Wrong solution. You should never convert a number to a string (that is displayed to the user) without NumberFormat or NumberFormat2. https://www.b4x.com/android/forum/pages/results/?query=numberformat Upvote 0
Wrong solution. You should never convert a number to a string (that is displayed to the user) without NumberFormat or NumberFormat2. https://www.b4x.com/android/forum/pages/results/?query=numberformat