Previously the decimal class only accepted number values and did not allow for precision to be passed in.
Javascript handles numbers with large precision pretty funkily. Allowing for values to be passed as string can help avoid javascript weirdness.
Some ERC20 contracts do not use 18 decimals of precision (ex. USDC, WBTC). In order to be able to use the decimal class to get BigNumbers, it must support different levels of precision. This PR adds an optional precision parameter to be specified. It must be 0 <= p <= 18.
Previously the decimal class only accepted number values and did not allow for precision to be passed in.
Javascript handles numbers with large precision pretty funkily. Allowing for values to be passed as string can help avoid javascript weirdness.
Some ERC20 contracts do not use 18 decimals of precision (ex. USDC, WBTC). In order to be able to use the decimal class to get BigNumbers, it must support different levels of precision. This PR adds an optional
precision
parameter to be specified. It must be 0 <= p <= 18.