backscratcher

 

magnitude

Page history last edited by tbarron 1 yr ago

magnitude

 


#!/usr/bin/perl

$value = $ARGV[0];

@units = qw/b Kb Mb Gb Tb Pb Eb/;

$unit = shift(@units);
for ($try = $value ; 1024 <= $try ; $try /= 1024)
{
   $unit = shift(@units);
}

printf("%s = %3.2f %sn", $value, $try, $unit);

Comments (0)

You don't have permission to comment on this page.