#12681 added decimals in module module_freepercentdisk

This commit is contained in:
Daniel Cebrian 2024-01-25 16:41:58 +01:00
parent 7b98866468
commit cf500b6843
2 changed files with 2 additions and 2 deletions

View File

@ -3132,7 +3132,7 @@ sub module_freepercentdisk ($) {
return () unless defined ($Parts{$module->{'params'}}) and defined ($Parts{$module->{'params'}}{'avail'});
my $availp = sprintf("%d", $Parts{$module->{'params'}}{'avail'} * 100 / $Parts{$module->{'params'}}{'total'});
my $availp = sprintf("%.2f", $Parts{$module->{'params'}}{'avail'} * 100 / $Parts{$module->{'params'}}{'total'});
return ($availp);
}

View File

@ -25,7 +25,7 @@ For Each objItem in colItems
If argc = 0 Or argv.Exists(objItem.Name) Then
' Include only harddrivers (type 3)
If (objItem.FreeSpace <> "") AND (objItem.DriveType =3) Then
Percent = round (100 - (objItem.FreeSpace / objItem.Size) * 100, 0)
Percent = round (100 - (objItem.FreeSpace / objItem.Size) * 100, 2)
Wscript.StdOut.WriteLine "<module>"
Wscript.StdOut.WriteLine " <name><![CDATA[DiskUsed_" & objItem.Name & "]]></name>"
Wscript.StdOut.WriteLine " <description><![CDATA[% used space. Filesystem unit: " & objItem.Name & "]]></description>"