How to compare two Doubles with given tolerance

Hello,

I read expected Double values from CSV file.
The actual value is coming from JSON response.
I would like to compare these two values in .check(), but .is() check fails due to precision/rounding issues.

  1. Is there a way how to compare two doubles (stored in session as ${expected} and ${actual}) with a given tolerance?
  2. Or is there a way how to subtract these values and use .smallerThan(tolerance)?

Thanks, Stefan

Hi Stefan, you can perform the comparison in a separate method returning a boolean value, then check for this value.