This commit is contained in:
sion
2026-04-08 01:09:57 +08:00
parent 007915b6f2
commit 26169accff
11 changed files with 776 additions and 81 deletions

View File

@@ -218,8 +218,10 @@ class _TransferPageState extends State<TransferPage>
void _setQuickAmount(double percent) {
final available = double.tryParse(_availableBalance) ?? 0;
final amount = available * percent;
_amountController.text = amount.toStringAsFixed(8).replaceAll(RegExp(r'\.?0+$'), '');
// 向下截斷到2位小數避免四捨五入超出餘額
_amountController.text =
((amount * 100).truncateToDouble() / 100).toStringAsFixed(2);
// Trigger haptic feedback
HapticFeedback.selectionClick();
}