default to less than 30 decimal places for nano

This commit is contained in:
julian 2023-05-30 10:02:41 -06:00
parent 3275039d01
commit 9c58df7cfd

View file

@ -8,6 +8,8 @@
* *
*/ */
import 'dart:math';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:stackwallet/db/hive/db.dart'; import 'package:stackwallet/db/hive/db.dart';
import 'package:stackwallet/utilities/amount/amount_unit.dart'; import 'package:stackwallet/utilities/amount/amount_unit.dart';
@ -864,7 +866,8 @@ class Prefs extends ChangeNotifier {
boxName: DB.boxNamePrefs, boxName: DB.boxNamePrefs,
key: "maxDecimalsFor${coin.name}", key: "maxDecimalsFor${coin.name}",
) as int? ?? ) as int? ??
coin.decimals; max(coin.decimals,
18); // use some sane max rather than up to 30 that nano uses
_amountDecimals[coin] = decimals; _amountDecimals[coin] = decimals;
} }
} }