getPercentageMore method

int getPercentageMore(
  1. Money other
)

Returns a approximation of many percent more than other money object, out of 100, as int

Implementation

int getPercentageMore(Money other)
{
  if (value + other.value == 0) {
    return 0;
  }
  else {
    return ((value - other.value) / value * 100).round();
  }
}