ASP common functions storage unit conversion function: FormatFileSize()
Author:Eve Cole
Update Time:2009-06-26 18:09:25
程序代码
<%
'功能:储存单位转换函数
Function FormatFileSize(iSize)
Dim aUnits, I
aUnits = Array("B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB")
I = Log(Abs(iSize)) 7
If I > UBound(aUnits) Then I = UBound(aUnits)
FormatFileSize = FormatNumber(iSize / (1024 ^ I), 2, -1) & " " & aUnits(I)
End Function
%>