Avgtemp is a double. Here is the code:
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim bmstemp, thermotemp,guntemp, avgtemp As Double
Dim bmp As Bitmap
End Sub
Sub Activity_Create(FirstTime As Boolean)
Bmp.Initialize(File.DirAssets, "android48.png")
Log(NumberFormat2(29.0, 0, 2, 2, False))
getbmstemp
getthermotemp
getguntemp
showtemps
End Sub
Sub getbmstemp
Dim nd As NumberDialog
nd.Digits = 3
nd.Number = 290
nd.Decimal = 1
nd.ShowSign = False
ret = nd.Show("Enter BMS Temperature reading", "Done", "", "",Bmp)
bmstemp = nd.Number/10
End Sub
Sub getthermotemp
Dim nd As NumberDialog
nd.Digits = 3
nd.Number = 290
nd.Decimal = 1
nd.ShowSign = False
ret = nd.Show("Enter Thermometer Temperature reading", "Done", "", "",Bmp)
thermotemp = nd.Number/10
End Sub
Sub getguntemp
Dim nd As NumberDialog
nd.Digits = 3
nd.Number = 290
nd.Decimal = 1
nd.ShowSign = False
ret = nd.Show("Enter Gun Thermometer Temperature reading", "Done", "", "",Bmp)
guntemp = nd.Number/10
End Sub
Sub Showtemps
avgtemp = (NumberFormat2((bmstemp + thermotemp + guntemp)/3, 0, 1, 1, False))
Log(NumberFormat2(29.0, 0, 1, 1, False))
Msgbox("BMS " &bmstemp & CRLF & "Thermometer " & thermotemp & CRLF & "Gun " & guntemp & CRLF & "Average " & avgtemp, "Today's readings are")
End Sub
Sub Showdate
DateTime.DateFormat = "dd-MM-yyyy"
Dim now As Long
now = DateTime.Now
Dim s As String
s = DateTime.Date(now)
Msgbox(s,"")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub