Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
Dim number As Int
number = 123
IntToFloat(number,10)
IntToFloat(number,100)
IntToFloat(number,1000)
End Sub
Sub IntToFloat(src As Int, devider As Int) As String
Log(">IntToFloat("&src&","&devider&"):")
Dim intasfloat As Float
intasfloat = src
Log (">"&NumberFormat(intasfloat,0,2))
intasfloat = intasfloat / devider
Log ("<"&NumberFormat(intasfloat,0,2))
Return NumberFormat(intasfloat,0,2)
End Sub
You don't need to cast the value to a float, as NumberFormat2 requires a Double, it will automatically cast the value to a Double anyway. You can just do: