]> ruin.nu Git - ndwebbie.git/blobdiff - lib/NDWeb/Include.pm
Converted rankings
[ndwebbie.git] / lib / NDWeb / Include.pm
index ff5a8825a20fc9f39ec0e62cea7ad0b6bdcfb389..4b94597e79c7857d63e92e6b4fbc3f317dd3d69e 100644 (file)
@@ -27,12 +27,19 @@ use CGI qw/:standard/;
 our @ISA = qw/Exporter/;
 
 our @EXPORT = qw/parseMarkup min max
-       alliances intelquery html_escape/;
+       alliances intelquery html_escape
+       comma_value/;
 
 sub html_escape($) {
        return CGI::escapeHTML @_;
 }
 
+sub comma_value ($) {
+       my ($v) = @_;
+       $v =~ s/(^[-+]?\d+?(?=(?>(?:\d{3})+)(?!\d))|\G\d{3}(?=\d))/$1,/g;
+       return $v;
+}
+
 sub parseMarkup ($) {
        my ($text) = @_;