Skip to content

Commit

Permalink
Fixed #92
Browse files Browse the repository at this point in the history
  • Loading branch information
caseyryan committed Sep 7, 2022
1 parent b4a6a72 commit fde5052
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
12 changes: 8 additions & 4 deletions example/lib/pages/money_format_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ class _MoneyFormatPageState extends State<MoneyFormatPage> {
// trailingSymbol: '',
// thousandSeparator: ThousandSeparator.Period,
// mantissaLength: 0,
thousandSeparator: ThousandSeparator.Space, mantissaLength: 0,
thousandSeparator: ThousandSeparator.Space,
mantissaLength: 0,
trailingSymbol: "\$",
)
],
Expand Down Expand Up @@ -312,7 +313,8 @@ class _MoneyFormatPageState extends State<MoneyFormatPage> {
CurrencyInputFormatter(
leadingSymbol: CurrencySymbols.DOLLAR_SIGN,
useSymbolPadding: true,
thousandSeparator: ThousandSeparator.SpaceAndPeriodMantissa,
thousandSeparator:
ThousandSeparator.SpaceAndPeriodMantissa,
// ThousandSeparator.Comma,
)
],
Expand All @@ -337,7 +339,8 @@ class _MoneyFormatPageState extends State<MoneyFormatPage> {
),
inputFormatters: [
CurrencyInputFormatter(
thousandSeparator: ThousandSeparator.SpaceAndPeriodMantissa,
thousandSeparator:
ThousandSeparator.SpaceAndPeriodMantissa,
trailingSymbol: ' USD',
// ThousandSeparator.Comma,
)
Expand All @@ -363,7 +366,8 @@ class _MoneyFormatPageState extends State<MoneyFormatPage> {
),
inputFormatters: [
CurrencyInputFormatter(
thousandSeparator: ThousandSeparator.SpaceAndCommaMantissa,
thousandSeparator:
ThousandSeparator.SpaceAndCommaMantissa,
trailingSymbol: ' U',
// ThousandSeparator.Comma,
)
Expand Down
3 changes: 2 additions & 1 deletion lib/formatters/currency_input_formatter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,8 @@ class CurrencyInputFormatter extends TextInputFormatter {
var nextChar = '';
if (caretPosition < newText.length - 1) {
nextChar = newText[caretPosition];
if (!isDigit(nextChar, positiveOnly: true) || int.tryParse(nextChar) == 0) {
if (!isDigit(nextChar, positiveOnly: true) ||
int.tryParse(nextChar) == 0) {
return true;
}
}
Expand Down

0 comments on commit fde5052

Please sign in to comment.