trim excess digits

This commit is contained in:
sneurlax 2023-01-27 14:38:10 -06:00
parent 4ddd4a292e
commit d5c3712067

View file

@ -1366,8 +1366,10 @@ class NumericalRangeFormatter extends TextInputFormatter {
TextEditingValue oldValue, TextEditingValue oldValue,
TextEditingValue newValue, TextEditingValue newValue,
) { ) {
final TextSelection newSelection = newValue.selection; TextSelection newSelection = newValue.selection;
String newVal = newValue.text; String newVal = _BuyFormState.buyWithFiat
? Decimal.parse(newValue.text).toStringAsFixed(2)
: Decimal.parse(newValue.text).toStringAsFixed(8);
if (newValue.text == '') { if (newValue.text == '') {
return newValue; return newValue;
} else { } else {