Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert hex string to decimal number #58

Closed
anhntsi opened this issue Nov 24, 2021 · 2 comments
Closed

Convert hex string to decimal number #58

anhntsi opened this issue Nov 24, 2021 · 2 comments

Comments

@anhntsi
Copy link

anhntsi commented Nov 24, 2021

I have to try convert hex string: 0x00000000000000000000000000000000000000000000000a4cc799563c380000 but library return nil.

How to convert it?

@twodayslate
Copy link
Collaborator

Please provide your exact code sample.

@mgriebling
Copy link
Contributor

mgriebling commented Feb 6, 2022

I was able to duplicate this problem with the following code:

if let x1 = BInt(prefixedNumber: "0x00000000000000000000000000000000000000000000000a4cc799563c380000") {
    print("x1 = ", x1.asString(radix: 16))
} else {
    print("x1 returns nil for BInt(prefixedNumber: \"0x00000000000000000000000000000000000000000000000a4cc799563c380000\", radix:16)")
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants