loopr-ios
loopr-ios copied to clipboard
Deprecate public static func generateBigInt(valueInEther: Double, symbol: String) -> GethBigInt?
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?