flexi_formatter 1.0.0
flexi_formatter: ^1.0.0 copied to clipboard
A flexible and customizable Dart/Flutter library for formatting numbers, dates, and other data types.
FlexiFormatter #
A flexible and customizable Dart/Flutter library for formatting numbers, dates, and other data types.
For instance :
/// 987654321.123456789 => '987654321.12345'
print(formatNumber(987654321.123456789.d, precision: 5, mode: RoundMode.floor));
/// 1234567890.12345 => '$1,234,567,890.12'
print(formatPrice(1234567890.12345.d, precision: 2, prefix: '\$'));
/// 9876543210.1 => '9.88B'
print(formatAmount(9876543210.1.d));
Usage #
To use this library in your code :
- add a dependency in your
pubspec.yaml
:
dependencies:
flexi_formatter:
- add import in your
dart
code :
import 'package:flexi_formatter/flexi_formatter.dart';
- Start formatting using
formatNumber(987654321.0123456789.d, precision: 5)
.
License #
Apache 2.0