format output disksize





5
Date Submitted Thu. Mar. 2nd, 2006 4:25 AM
Revision 1 of 1
Syntax Master dannyboy
Tags disksize | Format | VBSCRIPT
Comments 0 comments
mySizeDisk: this function just formats the output the way I like
Input integer in Bytes, outputs easily human readable format

Function mySizeDisk(integerSize)

If integerSize >= 1000000000 Then
        mySizeDisk = round(integerSize / 1000000000, 2)
        mySizeDisk = mySizeDisk & " GB"
ElseIf ((1000000000 > integerSize) And (integerSize >= 1000000)) Then
        mySizeDisk = round(integerSize / 1000000, 2)
        mySizeDisk = mySizeDisk & " MB"
ElseIf ((1000000 > integerSize) And (integerSize >= 1000)) Then
        mySizeDisk = round(integerSize / 1000, 2)
        mySizeDisk = mySizeDisk & " KB"
Else
        mySizeDisk = integerSize & " Bytes"
End If

End Function
 

Comments

There are currently no comments for this snippet.

Voting