X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=ND%2FInclude.pm;h=9a42d97b092f062599c628e7e72e7257bbde2de3;hb=7b149393a59ae55d92ade1243df82658f6c1aea8;hp=257ae91f205afea45e8cd48cdbf35ee4342af2c3;hpb=78b07c0a2aab8d21b6609c2c93fd2db5876c0d18;p=ndwebbie.git diff --git a/ND/Include.pm b/ND/Include.pm index 257ae91..9a42d97 100644 --- a/ND/Include.pm +++ b/ND/Include.pm @@ -51,9 +51,10 @@ sub parseValue { sub prettyValue { my ($value,$decimals) = @_; + return sprintf('%.3e',$value) if $value > 1000000000000000; my $unit = ''; my @units = ('k','M','G','T'); - for (my $i = 0; $value >= 1000;$i++){ + for (my $i = 0; $value >= 1000 && $i < 4;$i++){ $value /= 1000; $unit = $units[$i]; } @@ -83,7 +84,7 @@ sub intel_log { sub pa_xp { my ($roids,$ascore,$avalue,$tscore,$tvalue) = @_; - my $bravery = (min(2,$tscore/$ascore)-0.6) * (min(2,$tvalue/$avalue)-0.4); + my $bravery = (max(0,min(2,$tscore/$ascore)-0.6)) * (min(2,$tvalue/$avalue)-0.4); return int(max($roids * 10 * $bravery,0)) }