]> ruin.nu Git - ndwebbie.git/blobdiff - lib/NDWeb/Include.pm
Converted rankings
[ndwebbie.git] / lib / NDWeb / Include.pm
index e35567a6d3ce5c9b970b00e228b2c99545dc0fc6..4b94597e79c7857d63e92e6b4fbc3f317dd3d69e 100644 (file)
@@ -22,11 +22,23 @@ use strict;
 use warnings;
 require Exporter;
 use BBCode::Parser;
+use CGI qw/:standard/;
 
 our @ISA = qw/Exporter/;
 
 our @EXPORT = qw/parseMarkup min max
-       alliances intelquery /;
+       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) = @_;