fabero Member Licensed User Longtime User May 24, 2015 #1 For example I have a hexadecimal number (so is a String value), how I can convert it? So how to convert FF to 255 ? My goal is to convert numbers can be at maximum and Int64 value. Thanks in advance.
For example I have a hexadecimal number (so is a String value), how I can convert it? So how to convert FF to 255 ? My goal is to convert numbers can be at maximum and Int64 value. Thanks in advance.
fixit30 Active Member Licensed User Longtime User May 24, 2015 #2 This might help... Hex to decimal conversion Upvote 0
fabero Member Licensed User Longtime User May 24, 2015 #3 I see that but I don't understand the solution. For Example if I passing F000000 is my hexadecimal number to convert I obtain java.lang.NumberFormatException: For input string: "F0000000" if the number is FF no problem, it was converted to 255 Upvote 0
I see that but I don't understand the solution. For Example if I passing F000000 is my hexadecimal number to convert I obtain java.lang.NumberFormatException: For input string: "F0000000" if the number is FF no problem, it was converted to 255
fixit30 Active Member Licensed User Longtime User May 24, 2015 #4 Can you post your code? The below gives me a result of 251658240 B4X: Dim i As Int i = Bit.parseint("F000000", 16) Upvote 0
Can you post your code? The below gives me a result of 251658240 B4X: Dim i As Int i = Bit.parseint("F000000", 16)
fabero Member Licensed User Longtime User May 24, 2015 #5 I Guess...This is my mistake... In my case the i value is a string value of a textfield text value. So I need to "convert" the string in an Int number... How to that? Upvote 0
I Guess...This is my mistake... In my case the i value is a string value of a textfield text value. So I need to "convert" the string in an Int number... How to that?
fixit30 Active Member Licensed User Longtime User May 24, 2015 #6 B4X: Dim i As Int i = Bit.parseint(textfield.text, 16) Upvote 0
fabero Member Licensed User Longtime User May 24, 2015 #7 It won't works. If the text field has 3412CDAB it works, if it has FFFFFFFF I gave java.lang.NumberFormatException: For input string: "FFFFFFFF" I suppose because the value is over the Int maximum positive value. Upvote 0
It won't works. If the text field has 3412CDAB it works, if it has FFFFFFFF I gave java.lang.NumberFormatException: For input string: "FFFFFFFF" I suppose because the value is over the Int maximum positive value.
fabero Member Licensed User Longtime User May 24, 2015 #8 I'm very disappointed. For my habits I post here in B4A forum, but I'm using the B4J project now. Sorry for the incovenience.. Upvote 0
I'm very disappointed. For my habits I post here in B4A forum, but I'm using the B4J project now. Sorry for the incovenience..