formatSubscription method

String formatSubscription(
  1. double price,
  2. String currencyCode,
  3. String period
)

Formats a subscription price with period.

formatSubscription(9.99, 'USD', 'month'); // '$9.99/month'
formatSubscription(99.99, 'USD', 'year'); // '$99.99/year'

Implementation

String formatSubscription(
  double price,
  String currencyCode,
  String period,
) {
  return '${format(price, currencyCode)}/$period';
}