toRupiah method
Converts the numeric string to Indonesian Rupiah formatted string.
Example:
"15000".toRupiah(); // "Rp15.000"
Implementation
String toRupiah({bool usingSymbol = true}) {
final value = toInt();
if (value == null) return "";
final formatter = NumberFormat.simpleCurrency(
locale: 'id_ID',
decimalDigits: 0,
);
final formatted = formatter.format(value);
return usingSymbol ? formatted : formatted.replaceAll('Rp', '');
}