loopr-ios icon indicating copy to clipboard operation
loopr-ios copied to clipboard

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

Open xiaowheat opened this issue 6 years ago • 0 comments

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 avatar May 14 '18 23:05 xiaowheat