Data One Broadband Statistics - Pretty Printing

This page is obsolete. Since Version 0.6, this script has the functionality described below built-in. You don't have to do this anymore.

If you think the output of this script doesn't look good, join the gang. Mr. Shreevatsa R thinks so too. He was so bothered by it that he changed it. His code for it is as shown below. Replace the part after the final else (from line 818) in dataone.pl, to the one shown below:
            else {
                print "\n";
                printf "Sent (according to BSNL)    : %6.3f GB = %8.3f MB\n",
                    $bsnl_send , ($bsnl_send * 1024);
                printf "Received (according to BSNL): %6.3f GB = %8.3f MB\n",
                    $bsnl_recv , ($bsnl_recv * 1024);
                printf "Total (according to BSNL)   : %6.3f GB = %8.3f MB\n",
                    $bsnl_total, ($bsnl_total * 1024);

                print "\n";
                my $total_usage = $usage + $free_usage;
                my $worst_case_billed_usage = $total_usage - $worst_case_free_usage;
                printf "Worst case free usage  :    %8d KB = %8.2f MB\n",
                    $worst_case_free_usage  , $worst_case_free_usage / 1024;
                printf "Worst case billed usage:    %8d KB = %8.2f MB\n",
                    $worst_case_billed_usage, $worst_case_billed_usage / 1024;

                print "\n";
                printf "Total usage : %8d KB = %8.2f MB = %6.3f GB\n",
                    $total_usage , $total_usage / 1024, $total_usage / (1024 * 1024);
                printf "Free usage  : %8d KB = %8.2f MB = %6.3f GB\n",
                    $free_usage  , $free_usage / 1024 , $free_usage / (1024 * 1024);
                printf "Billed usage: %8d KB = %8.2f MB = %6.3f GB\n",
                    $usage       , $usage     / 1024  , $usage / (1024 * 1024);
            }
        

The output after this change will be something like:

            Sent (according to BSNL)    :  0.034 GB =   34.816 MB
            Received (according to BSNL):  0.253 GB =  259.072 MB
            Total (according to BSNL)   :  0.287 GB =  293.888 MB

            Worst case free usage  :       56308 KB =    54.99 MB
            Worst case billed usage:      244872 KB =   239.13 MB

            Total usage :   301180 KB =   294.12 MB =  0.287 GB
            Free usage  :    61450 KB =    60.01 MB =  0.059 GB
            Billed usage:   239730 KB =   234.11 MB =  0.229 GB
        

Back to the main page

Get Firefox!