简单的问题是,我有一个产品编号1,它的价格被宣布为8 eth,有什么办法可以避免它的格式,以避免插入到卫的坚实?
发布于 2022-02-21 05:48:36
一个文字数字可以用魏、gwei或以太的后缀来指定以太的子名称,其中没有后缀的以太数被假定为魏。
contract EtherUnits {
uint public oneWei = 1 wei;
// 1 wei is equal to 1
bool public isOneWei = 1 wei == 1;
uint public oneEther = 1 ether;
// 1 ether is equal to 10^18 wei
bool public isOneEther = 1 ether == 1e18;
}
https://stackoverflow.com/questions/71207322
复制