diff --git a/CHANGELOG.md b/CHANGELOG.md index 192d419..c05e89f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +## [2.9.7] +- Fixed a period at the end if mantissa length is 0 https://github.com/caseyryan/flutter_multi_formatter/issues/106 ## [2.9.6] - Fixed https://github.com/caseyryan/flutter_multi_formatter/issues/105 ## [2.9.5] diff --git a/example/pubspec.lock b/example/pubspec.lock index f90b156..cf1211c 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -96,7 +96,7 @@ packages: path: ".." relative: true source: path - version: "2.9.6" + version: "2.9.7" flutter_test: dependency: "direct dev" description: flutter diff --git a/lib/formatters/formatter_utils.dart b/lib/formatters/formatter_utils.dart index 608962a..c8583d9 100644 --- a/lib/formatters/formatter_utils.dart +++ b/lib/formatters/formatter_utils.dart @@ -438,7 +438,11 @@ String _getThousandSeparator( String _getMantissaSeparator( ThousandSeparator thousandSeparator, + int mantissaLength, ) { + if (mantissaLength < 1) { + return ''; + } if (thousandSeparator == ThousandSeparator.Comma) { return '.'; } @@ -499,7 +503,7 @@ String toCurrencyString( if (value.isEmpty) { return value; } - String mSeparator = _getMantissaSeparator(thousandSeparator); + String mSeparator = _getMantissaSeparator(thousandSeparator, mantissaLength); String tSeparator = _getThousandSeparator(thousandSeparator); String? fractionalSeparator = _detectFractionSeparator(value); @@ -634,7 +638,6 @@ String toCurrencyString( } } value = sb.toString(); - print(value); return value; } diff --git a/pubspec.yaml b/pubspec.yaml index dfda696..d449a94 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_multi_formatter description: A package of formatters for international phone numbers, credit / debit cards and a masked formatter -version: 2.9.6 +version: 2.9.7 homepage: https://github.com/caseyryan/flutter_multi_formatter environment: diff --git "a/\320\277\321\203\320\261\320\273\320\270\320\272\320\260\321\206\320\270\321\217" "b/\320\277\321\203\320\261\320\273\320\270\320\272\320\260\321\206\320\270\321\217" index a48e580..c502f51 100644 --- "a/\320\277\321\203\320\261\320\273\320\270\320\272\320\260\321\206\320\270\321\217" +++ "b/\320\277\321\203\320\261\320\273\320\270\320\272\320\260\321\206\320\270\321\217" @@ -2,3 +2,4 @@ fvm flutter pub publish --dry-run проверка fvm flutter pub publish fvm flutter dartfmt . чтобы отформатировать все файлы как надо + \ No newline at end of file