rupee method

String rupee(
  1. double amount
)

Rs. amount

Implementation

String rupee(double amount) {
  final formattedAmount = NumberFormat.currency(
    symbol: (Intl.defaultLocale ?? 'en').startsWith('ne') ? 'रू.' : 'Rs.',
    customPattern: '\u00A4\u00A0##,##,##0.00',
  ).format(amount);

  if (formattedAmount.endsWith('.00')) {
    return formattedAmount.substring(0, formattedAmount.length - 3);
  }
  return formattedAmount;
}