ASP-小数位变整数位函数

来源:互联网 发布:家里灰尘 知乎 编辑:程序博客网 时间:2024/06/07 00:30

小数位变整数位
评论/浏览(0/0)发表时间:2007年5月14日 14时41分    http://user.qzone.qq.com/9655814
 
 
'适用:asp
'作用:返回数值的小数位的所有字符


Function Getall(re)
  If IsNumeric(re) then
    Getall=abs(re)-int(abs(re))
    Getall=Getall*10^(GetTail(re) -1)
  else
    Getall="当前变量不是数值类型!"
  end If
end Function

Function GetTail(re)
  If IsNumeric(re) then
    GetTail=len(abs(re)-int(abs(re)))
  else
    GetTail="当前变量不是数值类型!"
  end If
end Function


'调用方法:
response.write Getall("0.315")    '返回 315   

 

 

 

www.pass0.com

原创粉丝点击