From 9db2b208eb299ee7e26ffd7a70730afc7371f8b0 Mon Sep 17 00:00:00 2001 From: Juerd Waalboer Date: Mon, 29 Aug 2022 00:17:25 +0200 Subject: [PATCH] deposit: print formatted amount in prompt --- plugins/deposit | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/deposit b/plugins/deposit index 0de950d..6d62cbb 100644 --- a/plugins/deposit +++ b/plugins/deposit @@ -11,7 +11,7 @@ sub command :Tab(deposit) ($self, $cart, $command, @) { } sub amount :Tab(13.37,42) ($self, $cart, $amount, @) { - $self->{amount} = parse_amount($amount) + $self->{amount} = $amount = parse_amount($amount) or return REJECT, "Invalid amount"; call_hooks("deposit_methods", \my $message, $self->{deposit_methods} = {}); @@ -20,8 +20,8 @@ sub amount :Tab(13.37,42) ($self, $cart, $amount, @) { if keys %{ $self->{deposit_methods} }; $cart - ->add(+$self->{amount}, "Deposit", { is_deposit => 1 }) - ->add_contra("-deposits/other", -$self->{amount}, "Deposited by \$you"); + ->add(+$amount, "Deposit", { is_deposit => 1 }) + ->add_contra("-deposits/other", -$amount, "Deposited by \$you"); return ACCEPT; }