GordonFreeman Posted September 20, 2015 Share Posted September 20, 2015 Hi guys i having issues to get exacly size showed in my computer, my script:;Retorna o drive no formato D: ;$sDrive = StringLeft(@ScriptFullPath,3) $sDrive = "F:\" ;Retorna a label do drive no formato <Sistema> $sDriveLabel = DriveGetLabel($sDrive) ;Retorna o espaço livre do drive em megabytes como um float $iDriveSpaceFree = DriveSpaceFree($sDrive) ;Retorna o espaço total do drive em megabytes como um float $iDriveSpaceTotal = DriveSpaceTotal($sDrive) ;Retorna o espaço ocupado $iDriveSpaceUsed = $iDriveSpaceTotal - $iDriveSpaceFree ; Espaço Ocupado x 100 / Espaço Total $iPercent = ( $iDriveSpaceUsed * 100 ) / $iDriveSpaceTotal ConsoleWrite(@CRLF & Round($iDriveSpaceFree / 1024,2) & " GB livre(s) de " & Round($iDriveSpaceTotal / 1024,2) & " GB" & @CRLF) With the same script i get a wrong a correct results(Wrong)In my computer:92,0 / 98,9In AutoIt:92.01 / 98.95===============================(Correct)In my computer:7,28 / 7,91In AutoIt:7.28 / 7.91 thanks in advance Frabjous Installation Link to comment Share on other sites More sharing options...
czardas Posted September 20, 2015 Share Posted September 20, 2015 (edited) It seems to me that windows is rounding these numbers to three significant figures and you are rounding to two decimal places. That could possibly produce this degree of variance. Edited September 20, 2015 by czardas operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now