compareTo method

int compareTo(
  1. Currency other
)

Compares this currency to another by currency code.

Example:

final usd = Currency.getInstance('USD');
final eur = Currency.getInstance('EUR');
print(usd.compareTo(eur)); // negative value

Implementation

int compareTo(Currency other) => currencyCode.compareTo(other.currencyCode);