'Compare ``amount1`` and ``amount2`` after rounding them according to the
given currency\'s precision..
An amount is considered lower/greater than another amount if their rounded
value is different. This is not the same as having a non-zero difference!
For example 1.432 and 1.431 are equal at 2 digits precision,
so this method would return 0.
However 0.006 and 0.002 are considered different (returns 1) because
they respectively round to 0.01 and 0.0, even though
0.006-0.002 = 0.004 which would be considered zero at 2 digits precision.
:param float amount1: first amount to compare
:param float amount2: second amount to compare
:return: (resp.) -1, 0 or 1, if ``amount1`` is (resp.) lower than,
equal to, or greater than ``amount2``, according to
``currency``\'s rounding.
With the new API, call it like: ``currency.compare_amounts(amount1, amount2)``.'

@api.multi
def compare_amounts(self, amount1, amount2):

    return tools.float_compare(amount1, amount2, precision_rounding=self.rounding)
