asp
formatBytes
duraboys
2010. 8. 24. 23:00
http://hanhead.tistory.com/entry/formatBytes
<%
Function formatBytes(xspace)
If xspace < 1024 Then
formatBytes = xspace
ElseIf xspace >= 1024 And xspace < 1048576 Then
formatBytes = FormatNumber((xspace / 1024),2) & " K"
ElseIf xspace >= 1048576 And xspace < 1073741824 Then
formatBytes = FormatNumber((xspace / 1048576),2) & " M"
ElseIf xspace >= 1073741824 then
formatBytes = FormatNumber((xspace/1073741824),2) & "G"
End If
End Function
%>
Function formatBytes(xspace)
If xspace < 1024 Then
formatBytes = xspace
ElseIf xspace >= 1024 And xspace < 1048576 Then
formatBytes = FormatNumber((xspace / 1024),2) & " K"
ElseIf xspace >= 1048576 And xspace < 1073741824 Then
formatBytes = FormatNumber((xspace / 1048576),2) & " M"
ElseIf xspace >= 1073741824 then
formatBytes = FormatNumber((xspace/1073741824),2) & "G"
End If
End Function
%>