Android Question Multi-precision Decimal to Hex conversion

Discussion in 'Android Questions' started by Derek Johnson, Feb 3, 2015.

  1. Derek Johnson

    Derek Johnson Active Member Licensed User

    Are there any libraries etc for B4A that will convert a 19-digit decimal number (in a string) to hex (in a string)?

    This is beyond the range of double.

    eg
    4234838936377479981 to 3AC52B9353C5D32D

    Derek
     
  2. keirS

    keirS Well-Known Member Licensed User

    You need the BigNumbers library.

    Code:
    Dim ABC As BigInteger
     ABC.Initialize(
    "4234838936377479981")
     
    Log(ABC.ToStringBase(16))
    The above code will do what you want.
     
    Derek Johnson likes this.
  3. Derek Johnson

    Derek Johnson Active Member Licensed User

    Thanks, I thought that there must be a solution.:)
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice