Skip to content

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

@xiaowheat

Description

@xiaowheat

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?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions