111
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user