Hello,
This code :
when I click the button i get :
Why? I want to get :
0.1
0.2
0.3
0.4
0.5
0.6
.
.
.
2.2
2.3
Somebody help !
Greets
John
This code :
B4X:
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private Button1 As Button
Private Label1 As Label
Private privValue As Double
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.SetFormStyle("UNIFIED")
MainForm.RootPane.LoadLayout("mainlayout") 'Load the layout file.
privValue = 0
MainForm.Show
End Sub
Sub Button1_Action
Dim addvalue As Int = 10
privValue = privValue + (1 / addvalue)
Label1.Text = privValue
Log(privValue)
End Sub
when I click the button i get :
Waiting for debugger to connect...
Program started.
0.1
0.2
0.30000000000000004
0.4
0.5
0.6
0.7
0.7999999999999999
0.8999999999999999
0.9999999999999999
1.0999999999999999
1.2
1.3
1.4000000000000001
1.5000000000000002
1.6000000000000003
1.7000000000000004
1.8000000000000005
1.9000000000000006
2.0000000000000004
2.1000000000000005
2.2000000000000006
2.3000000000000007
2.400000000000001
2.500000000000001
Why? I want to get :
0.1
0.2
0.3
0.4
0.5
0.6
.
.
.
2.2
2.3
Somebody help !
Greets
John