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

Deprecate public static func generateBigInt(valueInEther: Double, symbol: String) -> GethBigInt? #107

Open
xiaowheat opened this issue May 14, 2018 · 0 comments
Assignees

Comments

@xiaowheat
Copy link
Contributor

I think we should deprecate public static func generateBigInt(valueInEther: Double, symbol: String) -> GethBigInt?

Double has a precision of 15 decimal digits. For Double type, 1.123456789123456789 will be 1.1234567891234568 It's not correct to assume that valueInEther as a Double type won't be overflow.

It will return an error if users choose max value.

Proposed solution:
Use public static func generate(_ valueInEther: String, _ decimals: Int = 18) -> GethBigInt?

@xiaowheat xiaowheat assigned ghost and xiaowheat May 14, 2018
@dong77 dong77 unassigned ghost Sep 17, 2019
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

1 participant