Or if you want to round it,my $diff = ($new*10000) - ($old*10000);
my $diff = 0 + sprintf '%.0f', ($new*10000) - ($old*10000);
Update: The *10000 can be factored out: ($new-$old)*10000
In reply to Re^3: Calculating base difference of numbers
by ikegami
in thread Calculating base difference of numbers
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |