Skip to content

Commit

Permalink
Fixed #106
Browse files Browse the repository at this point in the history
  • Loading branch information
caseyryan committed Nov 22, 2022
1 parent bd2de50 commit 5adf186
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions lib/formatters/formatter_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,11 @@ String _getThousandSeparator(

String _getMantissaSeparator(
ThousandSeparator thousandSeparator,
int mantissaLength,
) {
if (mantissaLength < 1) {
return '';
}
if (thousandSeparator == ThousandSeparator.Comma) {
return '.';
}
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -634,7 +638,6 @@ String toCurrencyString(
}
}
value = sb.toString();
print(value);
return value;
}

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
1 change: 1 addition & 0 deletions публикация
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ fvm flutter pub publish --dry-run проверка
fvm flutter pub publish

fvm flutter dartfmt . чтобы отформатировать все файлы как надо

0 comments on commit 5adf186

Please sign in to comment.