Wish IsNumber function - Sandman (first post)    Aug 06, 2021   (3 reactions) Counterpoint:
It's well known that Anywhere Software works hard to make B4X available for beginners and shield them (and all of its users, really) from many of the complexities with developing applications. I think it's entirely fair to assume that the current behaviour of IsNumber simply is an ov B4A Question Empty String Issue - LucaMs (first post)    Apr 03, 2024   (1 reaction) Using IIF and IsNumber is a good solution.
In some cases, when empty string can equal zero, you can use the trick:
Dim Value As Int
Value = "0" & SomeB4XView.Text
(even directly in expressions, if desired) B4J Code Snippet [B4X]Using Infinity and NaN as special Numbers - William Lancee    Sep 06, 2020   (5 reactions) so it's argument is first converted to a string "NaN"
' which is (paradoxically) interpreted as a valid a number
Log(IsNumber(Sqrt(-1))) 'True
Log(IsNumber(0 / 0)) 'True
Log(IsNumber(0)) 'True
B4A Code Snippet Get data type from 1D string array - emexes (first post)    Dec 19, 2022 Why not IsNumber( arrString(r) ) ?
https://www.b4x.com/android/help/core.html#keywords_isnumber B4A Question java.lang.NullPointerException - agraham (first post)    Jul 28, 2022   (1 reaction) I've managed to reproduce the IsNumber null error within B4A. If you don't initialize a type instance the string items contain null rather than empty strings.
Sub Button1_Click
Dim x As configuration_
If IsNumber(x.language)=False Then ' NullPointerException here
Log("False")
End B4A Question Text.Contains - tufanv (first post)    Apr 04, 2016   (1 reaction) isnumber(text1.text) works for me . Thanks ! B4A Question IsNumber function fault - yeroen (first post)    Aug 05, 2021 The IsNumber function returns TRUE by "1f" and "1d".
So IsNumber gives unexpected results if you are not aware of this.
So I mean: Can the IsNumber function be changed in a next update? B4A Question Invalid double:"" - Erel (first post)    Sep 15, 2015   (1 reaction) IsNumber can be useful for such cases: If IsNumber(EditText1.Text) Then x = EditText1.Text + 10 B4A Question isNumber and cell phone number - udg (first post)    Nov 01, 2018   (1 reaction) IMHO, isNumber correctly returns True for "+41987654321" because the plus sign indicates a positive number.
I can't understand why you'd like to store a telephone number as a numeric value instead of a string/text, if that's your goal (in fact, I'm not sure to have understood it correctly). Wish B4X IIF Function - Erel (first post)    Jun 24, 2021   (8 reactions) This code will work:
Label1.Text = IIf(IsNumber(EditText1.Text), EditText1.Text * 10, "Invalid number") Page: 1   2   3   4   5   6   7   Powered by ColBERT |