This commit is contained in:
2026-04-08 02:13:29 +08:00
12 changed files with 903 additions and 82 deletions

View File

@@ -140,9 +140,11 @@ 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();
}