现在的位置: 首页 > 综合 > 正文

asp下实现格式化文件大小以MB显示的函数

2013年06月12日 ⁄ 综合 ⁄ 共 400字 ⁄ 字号 评论关闭

<%
'******************************
'函数:FormatFileSize(l1)
'参数:l1,字节数
'作者:阿里西西
'日期:2007/7/12
'描述:格式化文件大小样式
'示例:<%=FormatFileSize(l1)%>
'******************************
function FormatFileSize(l1)
dim l2,l3
l3=formatnumber(l1,0,true)
if l1>1048576 then
l2="("&formatnumber(l1/1048576,0,true)&" MB) "&l3
else
if l1>1024 then
l2="("&formatnumber(l1/1024,0,true)&" KB) "&l3
else
l2=formatnumber(l1,0,true)
end if
end if
llI=l2
end function
%>

抱歉!评论已关闭.