Merge pull request #287 from git001/patch-2
Fix Argument "NULL" isn't numeric
This commit is contained in:
commit
ccb435904c
1 changed files with 3 additions and 0 deletions
|
@ -302,6 +302,9 @@ sub infoprinthcmd {
|
|||
# Calculates the parameter passed in bytes, then rounds it to one decimal place
|
||||
sub hr_bytes {
|
||||
my $num = shift;
|
||||
return "0B" unless defined($num) ;
|
||||
return "0B" if $num eq "NULL" ;
|
||||
|
||||
if ( $num >= ( 1024**3 ) ) { #GB
|
||||
return sprintf( "%.1f", ( $num / ( 1024**3 ) ) ) . "G";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue