Skip to content

Commit

Permalink
Change Float to Integer
Browse files Browse the repository at this point in the history
  • Loading branch information
eloaders committed Jul 30, 2014
1 parent a9c95fa commit 2e9b7de
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions I-Nex/i-nex/.src/Disk_Drives.module
Original file line number Diff line number Diff line change
Expand Up @@ -128,24 +128,30 @@ Public Sub get_informations()
disks()
End

Function CalculateSIZE(Optional BlockSize As Float) As String
Dim REAL_SIZE_BYTES As Float
Dim REAL_SIZE_KIB As Float
Dim REAL_SIZE_MB As Float
Dim REAL_SIZE_GB As Float
Function CalculateSIZE(Optional BlockSize As Integer) As String
Dim REAL_SIZE_BYTES As Integer
Dim REAL_SIZE_KIB As Integer
Dim REAL_SIZE_MB As Integer
Dim REAL_SIZE_GB As Integer
'echo $[ $(cat /sys/block/sda/size) / 2 ]
REAL_SIZE_BYTES = (BlockSize * 512)
REAL_SIZE_KIB = (BlockSize / 2)
REAL_SIZE_MB = (BlockSize / 2 / 1024)
REAL_SIZE_GB = (BlockSize / 2 / 1024 / 1024)

Print REAL_SIZE_BYTES
Print REAL_SIZE_KIB
Print REAL_SIZE_MB
Print REAL_SIZE_GB
If REAL_SIZE_GB > 0 Then
Return Ceil(REAL_SIZE_GB) & " GB"
Else If REAL_SIZE_MB > 0 Then
Endif
If REAL_SIZE_MB > 0 Then
Return Ceil(REAL_SIZE_MB) & " MB"
Else If REAL_SIZE_KIB > 0 Then
Endif
If REAL_SIZE_KIB > 0 Then
Return Ceil(REAL_SIZE_KIB) & " KiB"
Else If REAL_SIZE_BYTES > 0 Then
Endif
If REAL_SIZE_BYTES > 0 Then
Return Ceil(REAL_SIZE_BYTES) & " Bytes"
Endif

Expand Down

0 comments on commit 2e9b7de

Please sign in to comment.