import 'package:intl/intl.dart';

void main() {
  num value = 5600.0;
  String formatted = '';
  
  try {
    final formatter = NumberFormat.currency(locale: 'id_ID', symbol: '', decimalDigits: value % 1 == 0 ? 0 : 2);
    formatted = formatter.format(value).trim();
    print('currency: $formatted');
  } catch (e) {
    print('error currency: $e');
    try {
      final fallback = NumberFormat.decimalPattern('id_ID');
      formatted = fallback.format(value);
      print('decimalPattern: $formatted');
    } catch(e2) {
      print('error decimalPattern: $e2');
      final fallbackUs = NumberFormat.decimalPattern();
      formatted = fallbackUs.format(value);
      print('fallbackUs: $formatted');
    }
  }
}
