bd_money_formatter
BDMoneyFormatter
is a Flutter package to formatting currencies according to the Bangladesh (BD) characteristics.
Features
- Convert any Amount to BD Money format.
- Support all kind of Data Types.
- Suitable for al type of flutter applications.
Installation
To use the 'Bangla Converter' Flutter package, follow these steps:
- Add the following line to the dependencies section in your project's
pubspec.yaml
file:
flutter pub add bd_money_formatter
- Import the package in your Dart code:
import 'package:bd_money_formatter/bd_money_formatter.dart';
Usage
BD Money Formatter
To Format, use the BDMoneyFormatter(decimalAmount).result.amount
method
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key});
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
double amount = 2554413646;
double decimalAmount = 97865466.352;
double negativeDecimalAmount = -456978.32;
BDMoneyFormatter output = BDMoneyFormatter(2554413646);
final TextStyle _style = const TextStyle(
color: Colors.black, fontSize: 16, fontWeight: FontWeight.bold);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text("BD Money Formatter"),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'BD Money Formatter Example',
style: _style.copyWith(fontSize: 20),
),
Text(
'It accept any kind of datatype',
style: _style,
),
const SizedBox(height: 20.0),
const Divider(),
Text(
'You have enter amount: $amount',
style: _style,
),
Text(
'Your output amount: ${output.result.amount}',
style: _style,
),
const Divider(),
Text(
'If Money is Decimal Number: $decimalAmount',
style: _style,
),
Text(
'Your output amount: ${BDMoneyFormatter(decimalAmount).result.amount}',
style: _style,
),
const Divider(),
Text(
'If Money is Negative Decimal Number: $negativeDecimalAmount',
style: _style,
),
Text(
'Your output amount: ${BDMoneyFormatter(negativeDecimalAmount).result.amount}',
style: _style,
),
],
),
),
);
}
}
Example Render UI
Demo
For more complete samples, you can grab it from the example directory.
Help Me
If you find some issues or bugs, please report here. You can also help in requesting new features here.
ChangeLog
Are you curious about the changes that occur in each version? See here for detailed informations.
Contributions
Contributions are welcome! If you encounter any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request.
Contributors
License
The 'BD Money Formatter' Flutter plugin is released under the MIT License.
Libraries
- bd_money_formatter
- bd_money_formatter library for access