Unavailable. Nobody can download this version any more, with elm or with the Lamdera compiler: github.com/quietgarden/elm-web3 is gone (deleted or private); Software Heritage not asked yet (this run's --swh-calls were used up); no fork with tag 2.0.1 found (5 same-name repos checked); no cached copy. Use another version.
ETH / ERC-20 unit conversion — pure Elm, no JS required.
formatEther (BigInt.fromInt 1500000000000000000) == "1.5"
parseEther "1.5" == Just <1500000000000000000>Parse a human-readable ETH string to Wei. Returns Nothing for invalid input, non-numeric strings, or negative values.
parseEther "1" == Just <10^18>
parseEther "1.5" == Just <1.5×10^18>
parseEther "0.000000000000000001" == Just (BigInt.fromInt 1)
parseEther "not-a-number" == Nothing
parseEther "-1" == NothingConvert a token amount (in its smallest unit) to a human-readable string for a token with the given number of decimal places. Trailing zeros are trimmed.
formatUnits 6 (BigInt.fromInt 1500000) == "1.5" -- USDC
formatUnits 8 (BigInt.fromInt 100000000) == "1" -- WBTCParse a human-readable token amount to its smallest unit, given the token's decimal count. Returns Nothing for invalid or negative input.
parseUnits 6 "1.5" == Just (BigInt.fromInt 1500000) -- USDC
parseUnits 6 "0" == Just BigInt.zero
parseUnits 6 "-1" == Nothing
Convert Wei to a human-readable ETH string with up to 18 significant decimal places. Trailing zeros are trimmed.