How to change this code into real format currency from Rp 1000 into Rp 1,000 the $totalBalance is the variable for connecting database
i am want to change this nominal into real formatted currency
Here the source code
Text( '\Rp $totalBalance', style: const TextStyle( fontSize: 20, color: AppTheme.darkGray, fontWeight: FontWeight.bold), )
CodePudding user response:
Try using NumberFormatter.currency from the intl
package.
import 'package:intl/intl.dart';
print(NumberFormat.currency(symbol: 'Rp ').format(1000)); // "Rp 1,000.00"