code: def __diff_numbers(self, level):
          
          t1_type = "number" if self.ignore_numeric_type_changes else level.t1.__class__.__name__
          t2_type = "number" if self.ignore_numeric_type_changes else level.t2.__class__.__name__
  
          if self.significant_digits is None:
              if level.t1 != level.t2:
                  self.__report_result('values_changed', level)
          else:
              # Bernhard10: I use string formatting for comparison, to be consistent with usecases where
              # data is read from files that were previousely written from python and
              # to be consistent with on-screen representation of numbers.
              # Other options would be abs(t1-t2)<10**-self.significant_digits
              # or math.is_close (python3.5+)
              # Note that abs(3.25-3.251) = 0.0009999999999998899 < 0.001
              # Note also that "{:.3f}".format(1.1135) = 1.113, but "{:.3f}".format(1.11351) = 1.114
              # For Decimals, format seems to round 2.5 to 2 and 3.5 to 4 (to closest even number)
              t1_s = self.number_to_string(level.t1,
                                           significant_digits=self.significant_digits,
                                           number_format_notation=self.number_format_notation)
              t2_s = self.number_to_string(level.t2,
                                           significant_digits=self.significant_digits,
                                           number_format_notation=self.number_format_notation)
  
              t1_s = KEY_TO_VAL_STR.format(t1_type, t1_s)
              t2_s = KEY_TO_VAL_STR.format(t2_type, t2_s)
              if t1_s != t2_s:
                  self.__report_result('values_changed', level)
docs: Diff Numbers