获取小数位位数函数
评论/浏览(0/0)发表时间:2007年5月14日 14时20分 http://user.qzone.qq.com/9655814
'适用:asp
'作用:返回数值的小数位位数
Function GetTail(re)
If IsNumeric(re) then
GetTail=len(abs(re)-int(abs(re)))
else
GetTail="当前变量不是数值类型!"
end If
end Function
'调用方法:
response.write GetTail("0.315") '返回 3
本文介绍了一个用于ASP的简单函数,该函数能够返回一个数值中小数部分的位数。通过使用此函数,开发者可以轻松地确定任何给定浮点数的小数精度。
336

被折叠的 条评论
为什么被折叠?



