amountInMajorUnits property

double get amountInMajorUnits

Get amount in major currency units (e.g., dollars instead of cents)

Implementation

double get amountInMajorUnits {
  // Most currencies use 2 decimal places, but some exceptions exist
  switch (currency.toUpperCase()) {
    case 'JPY':
    case 'KRW':
      return amount; // No decimal places
    default:
      return amount / 100; // Standard currencies with 2 decimal places
  }
}