pricePerWeekFormatted property

String get pricePerWeekFormatted

Implementation

String get pricePerWeekFormatted {
  final weeksInPeriod = switch (period) {
    SubscriptionPeriod.day => count / 7,
    SubscriptionPeriod.week => count,
    SubscriptionPeriod.month => count * 4,
    SubscriptionPeriod.year => count * 52,
  };

  final pricePerWeek = (price / weeksInPeriod).round();
  return Money.fromInt(
    pricePerWeek,
    isoCode: currency,
    decimalDigits: 2,
  ).toString();
}