Api Validations validated against a variable

Good day

Is there a way in which I can validate an API response result to a set response?
Example:

My API returns the following:
"Value":22691.958333333332, and I set validation on that field

WS.verifyElementPropertyValue(response, ‘Calculation[2].Value’, 22691.958333333332)

My Actual results should have been 2271, it’s almost as if I need an ‘IF’ statement
IF “Value” = 2271 then Pass.

I also need this set value of 2271 to be a variable it can change.

Thanks
JP