A a n g l o Active Member Licensed User Longtime User Jun 19, 2025 #1 is it totally safe to handle without casting : B4X: Dim i as int=EditText1.Text+EditText2.Text or is it safer to use : B4X: Dim i as int=EditText1.Text.AS(int)+EditText2.Text.AS(int) both EditTexts are numeric. same Q for the opposite direction (from int to EditText.Text with/without casting to string) Thank you
is it totally safe to handle without casting : B4X: Dim i as int=EditText1.Text+EditText2.Text or is it safer to use : B4X: Dim i as int=EditText1.Text.AS(int)+EditText2.Text.AS(int) both EditTexts are numeric. same Q for the opposite direction (from int to EditText.Text with/without casting to string) Thank you
teddybear Well-Known Member Licensed User Jun 19, 2025 #2 Both of them are safe, they use same method Double.parseDouble to do casting. just one does an explicit casting. From int to EditTextEditText.Text with/without casting to string. both of them use NumberToString method, no difference Upvote 0
Both of them are safe, they use same method Double.parseDouble to do casting. just one does an explicit casting. From int to EditTextEditText.Text with/without casting to string. both of them use NumberToString method, no difference