原贴地址:http://bbs.blueidea.com/thread-2864029-1-1.html
参考资料:http://zh.wikipedia.org/w/index.php?title=Yottabyte&variant=zh-cn

1
2
3
4
5
6
7
8
9
10
11
12
Public Function SenFe_GetFileSize(iSize)
	Dim aUnit, sUnit, I
	aUnit = Array("B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB")
	I = 0
	sUnit = aUnit(0)
	Do While iSize >= 1024 And I < UBound(aUnit)
		I = I + 1
		iSize = iSize / 1024
		sUnit = aUnit(I)
	Loop
	SenFe_GetFileSize = FormatNumber(iSize, 2) & " " & sUnit
End Function

转载请注明出处

本博客所有文章如无特别注明均为原创。
复制或转载请以超链接形式注明转自盛飞在线,原文地址《[原][ASP]储存单位转换小函数
上一篇:
Leave a Reply

Copyright © 盛飞在线 Theme DNSHH by Hang & Ben & S-kias / Wordpress)))