111
This commit is contained in:
@@ -205,7 +205,9 @@ class _TradePageState extends State<TradePage>
|
||||
|
||||
void _fillPercent(double pct) {
|
||||
final max = double.tryParse(_maxAmount) ?? 0;
|
||||
_amountController.text = (max * pct).toStringAsFixed(2);
|
||||
final value = max * pct;
|
||||
// 向下截斷到2位小數,避免四捨五入超出可用餘額
|
||||
_amountController.text = ((value * 100).truncateToDouble() / 100).toStringAsFixed(2);
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user