< Back
#25 Convert Ether

There is something wrong with this problem. My code for the problem is correct and it throws Invalid Big Integer String This is thrown by JS. The problem is being graded wrong. Please fix it.

function weiToEther(uint256 weiAmount) public pure returns (uint256) {
    require(weiAmount > 0, "Wei amount must be greater than zero");
    weiAmount = weiAmount / 1e18;
    return weiAmount;
Comments: 0

Be the first to comment...