i see where you doubled the cash... when the player hands in the plat and such in the first place, but if they break even, i don't see a divide of the bet or anything to turn it back to the original amount... maybe i'm missing something?
Code:
$cash = $cash * 2; #double the bet
as for rounding, you are rounding, its just not apparent i guess...
take this code, if your orginal amounts were as follows: 7 copper, 0 silver
you would get back 7 copper, 1 silver (literally just tested this in a lua sandbox just to make sure i wasn't going crazy)
Code:
my $cash = $qglobals{"bet"};
$copper = ($cash % 10);
$silver = (int ($cash / 10) % 10);
$gold = (int ($cash / 100) % 10);
$platinum = int ($cash / 1000);