Ditch floating point numbers, use cents instead; bump version to 3.2
This commit is contained in:
parent
9b582d5f9b
commit
38a0229899
17 changed files with 545 additions and 168 deletions
|
@ -41,9 +41,9 @@ sub hook_user_created {
|
|||
|
||||
sub hook_user_balance {
|
||||
my ($class, $user, $old, $delta, $new, $transaction_id) = @_;
|
||||
$_ = sprintf "%+.02f", $_ for $old, $delta, $new;
|
||||
my $lost = $delta < 0 ? "lost" : "got";
|
||||
$delta = abs($delta);
|
||||
$delta = $delta->abs;
|
||||
$_ = $_->string("+") for $old, $new;
|
||||
_log("BALANCE $transaction_id $user had $old, $lost $delta, now has $new");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue