Re: Re: Untitled

By Paltry Gorilla, 11 Years ago, written in Perl, viewed 808 times. This paste is a reply to Re: Untitled by Mungo Curlew
URL http://pb.stoleyour.com/view/519b61db Embed
Download Paste or View RawExpand paste to full width of browser
  1. my $in_prefix  = "K";
  2. my $out_prefix = "K";
  3.  
  4. if ( $in_traffic < 1024 ) {
  5.         $in_traffic = sprintf( "%.2f", $in_traffic / 1024 );
  6.         $in_prefix = "M";
  7. }
  8. if ( $out_traffic < 1024 ) {
  9.         $out_traffic = sprintf( "%.2f", $out_traffic / 1024 );
  10.         $out_prefix = "M";
  11. }
  12. if ( $in_traffic > 1024 ) {
  13.         $in_traffic = sprintf( "%.2f", $in_traffic / 1024 );
  14.         $in_prefix = "M";
  15. }
  16. if ( $out_traffic > 1024 ) {
  17.         $out_traffic = sprintf( "%.2f", $out_traffic / 1024 );
  18.         $out_prefix = "M";
  19. }
  20. if ( $in_traffic > 1024 * 1024 ) {
  21.         $in_traffic = sprintf( "%.2f", $in_traffic / 1024 * 1024 );
  22.         $in_prefix = "G";
  23. }
  24. if ( $out_traffic > 1024 * 1024 ) {
  25.         $out_traffic = sprintf( "%.2f",$out_traffic / 1024 * 1024 );
  26.         $out_prefix = "G";
  27. }

Reply to "Re: Re: Untitled"

Here you can reply to the paste above