Units In Solidity

[Solved] Units In Solidity | Solidity - Code Explorer | yomemimo.com
Question : units in solidity

Answered by : shirshak

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract MyUnits { // 1 wei == 1; // 1 gwei == 1e9; // 1 ether == 1e18; //we can use ether and gwei which will convert to wei automatically uint256 costOfNFT = 0.05 ether; // 1 == 1 seconds // 1 minutes == 60 seconds // 1 hours == 60 minutes // 1 days == 24 hours // 1 weeks == 7 days
//we can use hours,days and weeeks which will change to seconds uint256 levelUpRate = 1 hours;
}

Source : | Last Update : Thu, 05 May 22

Answers related to units in solidity

Code Explorer Popular Question For Solidity