Format Numbers

Peter Van Epp vanepp at sfu.ca
Thu Jun 19 11:40:45 EDT 2008


On Thu, Jun 19, 2008 at 02:06:13AM -0500, Barry Kolts wrote:
> Hi,
> 
> I am new to Argus and would like to know if it is possible to format the numbers in the output. For instance if a byte field has a number like 123456789 is it possible to format it to 123,456,789 or even in a form like 123MB? This would make them easier to read.
> 
> Thanks for your help,
> Barry

	Its not there now (I'll leave Carter to answer about whether it may
be in future ;-)). The following perl fragment will add commas if you run
the ra output through an appropriate perl script:


sub commas {
        local($_) = @_;
        1 while s/(.*\d)(\d\d\d)/$1,$2/;
        $_;
}

and called like this:

$pcount = &commas($count);

	I'm slowly working on updating my perl traffic scripts on

ftp.sfu.ca /pub/unix/argus/argus.traffic.perl.tar.gz from 2.0.6 to 3.0 but
haven't finished yet. 

Peter Van Epp / Operations and Technical Support 
Simon Fraser University, Burnaby, B.C. Canada



More information about the argus mailing list