Open
Description
What happened?
Calling Utilities.formatToPrecision(..., fallbackToScientific: true)
outputs a wrong value for some inputs.
What are the steps to reproduce?
let balance = BigInt("100000000000000000000")
let formatted = Utilities.formatToPrecision(balance, units: .ether, decimalSeparator: ",", fallbackToScientific: true)
What is the expected behavior?
Value in formatted
from the example above should be 1e20
but it's 0e-18
instead.
What is the error thrown?
What's the stack trace said?
OS version
Library version
3.1.1