I have used the following global to change <%Hits%> on the Top Rated page to display 1,234 instead of 1234.
my $tags = shift;
local $_ = $tags->{Hits};
return 0 unless defined $_;
1 while s/^([-+]?\d+)(\d{3})/$1,$2/;
return $_;
}
( Tag: changed <%Hits%> to <%Hits_formatted%> )
In links.html the code is slightly different:
Hits: <%intHits%>
Any ideas on how to format this?
Code:
sub { # show Hits (with commas - 123,456) my $tags = shift;
local $_ = $tags->{Hits};
return 0 unless defined $_;
1 while s/^([-+]?\d+)(\d{3})/$1,$2/;
return $_;
}
( Tag: changed <%Hits%> to <%Hits_formatted%> )
In links.html the code is slightly different:
Code:
<%~set intHits = $Hits i/ 1%> Hits: <%intHits%>
Any ideas on how to format this?