I'm trying to create a small script that converts MB to GB for a karamba theme so that my memory and hard drives display in GB rather than MB when over 1000MB. This is what I have thus far but it doesn't produce what I need:
my $value = $ARGV;
if ( $value > 1000 )
$value = sprintf "%f", ( $value / 1000 );
print $value . "\n\n";
~ $ ./test.pl 19335
I was hoping for 19.34 but I'm just not getting it.
Any assistance would be much appreciated.