]> ruin.nu Git - ndwebbie.git/commitdiff
moved functions to include file
authorMichael Andreen <harv@ruin.nu>
Sat, 13 Jan 2007 12:31:45 +0000 (12:31 +0000)
committerMichael Andreen <harv@ruin.nu>
Sat, 13 Jan 2007 12:31:45 +0000 (12:31 +0000)
ND/IRC/PA.pm
ND/Include.pm

index fbe2a8457de9ddd22f44ee1296dfaa66fbed5e69..f1444a247f5610cbcd10351f80f65e624b7e899f 100644 (file)
@@ -20,6 +20,7 @@ package ND::IRC::PA;
 use strict;
 use warnings;
 use ND::DB;
+use ND::Include;
 use ND::IRC::Access;
 use ND::IRC::Misc;
 use POSIX;
@@ -138,39 +139,6 @@ FROM ship_stats WHERE name ILIKE ?
        #print $text;
 }
 
-sub parseValue {
-       if (defined $_[0] && $_[0] =~ /^(-?\d+(?:\.\d+)?)([khMG])?$/){
-               return $1 unless defined $2;
-               return $1*100 if $2 eq 'h';
-               return $1*1000 if $2 eq 'k';
-               return $1*1000000 if $2 eq 'M';
-               return $1*1000000000 if $2 eq 'G';
-       }
-       return $_[0];
-}
-
-sub prettyValue {
-       my ($value) = @_;
-       my $unit = '';
-       my @units = ('k','M','G','T');
-       for (my $i = 0; $value >= 1000;$i++){
-               $value /= 1000;
-               $unit = $units[$i];
-       }
-       return sprintf('%.2f%s', $value,$unit);
-}
-
-
-sub min {
-       my ($x,$y) = @_;
-       return ($x > $y ? $y : $x);
-}
-
-sub max {
-       my ($x,$y) = @_;
-       return ($x < $y ? $y : $x);
-}
-
 sub calcXp {
        my ($x,$y,$z,$roids) = @_;
 
index 53e7a4c17580a48c1e26c2c0d6d36b0690547d51..421d81ea044e47f3149b0a4d1c24787235cc0113 100644 (file)
@@ -25,7 +25,7 @@ require Exporter;
 
 our @ISA = qw/Exporter/;
 
-our @EXPORT = qw/min max log_message intel_log unread_query/;
+our @EXPORT = qw/min max parseValue prettyValue log_message intel_log unread_query/;
 
 sub min {
     my ($x,$y) = @_;
@@ -37,6 +37,30 @@ sub max {
     return ($x < $y ? $y : $x);
 }
 
+
+sub parseValue {
+       if (defined $_[0] && $_[0] =~ /^(-?\d+(?:\.\d+)?)([khMG])?$/){
+               return $1 unless defined $2;
+               return $1*100 if $2 eq 'h';
+               return $1*1000 if $2 eq 'k';
+               return $1*1000000 if $2 eq 'M';
+               return $1*1000000000 if $2 eq 'G';
+       }
+       return $_[0];
+}
+
+sub prettyValue {
+       my ($value) = @_;
+       my $unit = '';
+       my @units = ('k','M','G','T');
+       for (my $i = 0; $value >= 1000;$i++){
+               $value /= 1000;
+               $unit = $units[$i];
+       }
+       return sprintf('%.2f%s', $value,$unit);
+}
+
+
 sub log_message {
        my ($uid, $message) = @_;
        my $log = $ND::DBH->prepare_cached(q{INSERT INTO forum_posts (ftid,uid,message) VALUES(