改进一下asp自带的formatNumber函数
摘要:asp的formatNumber再处理类似25/5的值时,结果是5.00处理类似28/8的值时,结果是3.50改进一下,去掉没用的0让结果分...
asp的formatNumber再处理类似25/5的值时,结果是5.00处理类似28/8的值时,结果是3.50
改进一下,去掉没用的0让结果分别是5和3.5
复制代码 代码如下:
Functionfm(nb)
IfIsNumeric(nb)Then
Dima
a=FormatNumber(nb,2,-1)
IfRight((a+""),2)=00Then
fm=CLng(a)
Else
fm=FormatNumber(nb,1,-1)
Endif
Else
fm=0
Endif
EndFunction
【改进一下asp自带的formatNumber函数】相关文章:
上一篇:
禁止站外提交表单
下一篇:
收集asp的常用函数