I am trying to get a lower and upper threshold on a value in solidity.
function foo(uint value) public {
uint lower_threshold = value * 0.5;
uint upper_threshold = value * 1.5;
}
With the above code, I get the following error:
TypeError: Operator * not compatible with types uint32 and rational_const 1 / 2
My goal is to check that the value passed is within the threshold to perform some action. Is there a way to do this in Solidity?