Why does below control structure return 250 in both value scenarios?
function bonusCalculate(uint _value) public pure returns(uint) {
if(_value <= 50 ether) {
return 250;
} else if (_value >= 100 ether) {
return 500;
}
}
Best Answer
because your code is equivalent to
1 ether= 1000000000000000000.