Android Question IsNumber ok.. but what about IsDecimal

eurojam

Well-Known Member
Licensed User
Longtime User
try
B4X:
Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    'Activity.LoadLayout("Layout1")
    Log( isDecimal("12.3"))
    Log (isDecimal("12"))

End Sub


Sub isDecimal (s As String) As Boolean
    Dim d As Double
    Dim i As Int
    Try
        d = s
        i = s
        If d-i > 0 Then
            Return True
        Else
            Return False   
        End If
       
    Catch
        Return False
    End Try
End Sub
 
Upvote 0
Top