Module utils

Module utils 

Source
Expand description

Utilities for parsing and formatting SqlU256 with decimals (e.g. for ERC20/ETH amounts).

Functions§

format_sether
Formats a SqlU256 as Ether (18 decimals).
format_suint
Formats a SqlU256 as a decimal string with the given number of decimals.
parse_sether
Parses a decimal string as Ether (18 decimals).
parse_suint
Parses a decimal string (e.g. “1.23”) into a SqlU256, given the number of decimals.