From f524de024e55d27e5911d45d47db186eb30d5580 Mon Sep 17 00:00:00 2001 From: gdsotirov Date: Wed, 7 Jun 2017 13:47:48 +0300 Subject: [PATCH] Format Tera Bytes (add message message179 to awstats-en.txt and one more if to function Format_Bytes from awstats.pl) --- wwwroot/cgi-bin/awstats.pl | 3 +++ wwwroot/cgi-bin/lang/awstats-en.txt | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl index 091d6823..5c498475 100755 --- a/wwwroot/cgi-bin/awstats.pl +++ b/wwwroot/cgi-bin/awstats.pl @@ -8104,6 +8104,9 @@ sub Format_Bytes { my $fudge = 1; # Do not use exp/log function to calculate 1024power, function make segfault on some unix/perl versions + if ( $bytes >= ( $fudge << 40 ) ) { + return sprintf( "%.2f", $bytes / 1099511627776 ) . " $Message[179]"; + } if ( $bytes >= ( $fudge << 30 ) ) { return sprintf( "%.2f", $bytes / 1073741824 ) . " $Message[110]"; } diff --git a/wwwroot/cgi-bin/lang/awstats-en.txt b/wwwroot/cgi-bin/lang/awstats-en.txt index 40b9e612..2de654d5 100644 --- a/wwwroot/cgi-bin/lang/awstats-en.txt +++ b/wwwroot/cgi-bin/lang/awstats-en.txt @@ -179,4 +179,5 @@ message174=Safari versions message175=Chrome versions message176=Konqueror versions message177=, -message178=Downloads \ No newline at end of file +message178=Downloads +message179=TB \ No newline at end of file -- 2.47.2