… | |
… | |
55 | $currency = $amount > 1 ? $coin->name_pl : $coin->name; |
55 | $currency = $amount > 1 ? $coin->name_pl : $coin->name; |
56 | |
56 | |
57 | my $pay = $amount * $coin->value; |
57 | my $pay = $amount * $coin->value; |
58 | |
58 | |
59 | # First check for possible overflow and user stupidity |
59 | # First check for possible overflow and user stupidity |
60 | if ($amount > 2**30) { |
60 | if ($pay > 2**30) { |
61 | return "Sorry, we do not handle that kind of money for one $action."; |
61 | return "Sorry, we do not handle that kind of money for one $action."; |
62 | } elsif ($amount == 0) { |
62 | } elsif ($pay == 0) { |
63 | return "You can not $action nothing."; |
63 | return "You can not $action nothing."; |
64 | } elsif ($amount < 0) { |
64 | } elsif ($pay < 0) { |
65 | return "You can not $action negative values."; |
65 | return "You can not $action negative values."; |
66 | } |
66 | } |
67 | |
67 | |
68 | # Here we handle the transactions |
68 | # Here we handle the transactions |
69 | if ($action eq "deposit") { |
69 | if ($action eq "deposit") { |