From af4d05c4dac3fa2e2d566e3cf5f7e3d3e3ea6323 Mon Sep 17 00:00:00 2001 From: Juerd Waalboer Date: Mon, 24 Apr 2017 21:49:20 +0200 Subject: [PATCH] Round amounts in prompt for give/take reason --- plugins/give | 10 +++++----- plugins/take | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/plugins/give b/plugins/give index 858c80e..3a0f207 100755 --- a/plugins/give +++ b/plugins/give @@ -25,11 +25,11 @@ sub amount { $self->{amount} = parse_amount($input) or return REJECT, "$input: Invalid amount."; - my $benificiary = $self->{benificiary}; - my $amount = $self->{amount}; - - return "Why are you giving $amount to $benificiary, " - . "or enter your username to end", \&reason; + return sprintf( + "Why are you giving %.2f to %s, or enter your username to end", + $self->{amount}, + $self->{benificiary} + ), \&reason; } sub reason :Tab(whatevah) { diff --git a/plugins/take b/plugins/take index 2ec1906..9d1fc58 100755 --- a/plugins/take +++ b/plugins/take @@ -32,7 +32,8 @@ sub arg :Tab(USERS) { my $them = @users == 1 ? $users[0] : 'each'; - return "Why are you taking $each from $them?", \&reason; + return sprintf("Why are you taking %.2f from %s?", $each, $them), + \&reason; } my $user = parse_user($arg);