Level Sensor Height Change conversion to gallons

There has to be a nicer way to do this.

Arithmetic

if (inches = 2){

would be if (inches == 2){