Fulvio75 Well-Known Member Licensed User May 18, 2023 #1 Ciao c'è un modo per conoscere se inserisco un numero frazionario? Es.: Inserisco 1 mi deve dare false Inserisco 1.5 mi deve dare true
Ciao c'è un modo per conoscere se inserisco un numero frazionario? Es.: Inserisco 1 mi deve dare false Inserisco 1.5 mi deve dare true
Star-Dust Expert Licensed User Longtime User May 18, 2023 #2 B4X: Dim i as Float = 1.5 Dim IsFrac as Boolean=i<>Floor(i) log("E' frazionario: " & IsFrac)
Star-Dust Expert Licensed User Longtime User May 18, 2023 #3 B4X: Dim i As Float = 1.5 Dim IsFrac As Boolean=i.As(String).Contains(".") Log("E' frazionario: " & IsFrac)
B4X: Dim i As Float = 1.5 Dim IsFrac As Boolean=i.As(String).Contains(".") Log("E' frazionario: " & IsFrac)
Star-Dust Expert Licensed User Longtime User May 18, 2023 #4 B4X: Dim i As Float = 1.5 Dim IsFrac As Boolean=(i Mod 1)>0 Log("E' frazionario: " & IsFrac)
Star-Dust Expert Licensed User Longtime User May 18, 2023 #5 B4X: Dim i As Float = 1.5 Dim IsFrac As Boolean=Regex.IsMatch("\d+(.|,)\d+",i) Log("E' frazionario: " & IsFrac)
B4X: Dim i As Float = 1.5 Dim IsFrac As Boolean=Regex.IsMatch("\d+(.|,)\d+",i) Log("E' frazionario: " & IsFrac)