如何准确地获得一个整数?
程序员文章站
2023-01-25 17:56:07
如何准确地获得一个整数?function numbersonlynodecimals(pinstring)&nb...
如何准确地获得一个整数?
function numbersonlynodecimals(pinstring)
lnumbersonly = ""
for x = 1 to len(pinstring)
y = (len(pinstring)-x+1)
if isnumeric(mid(pinstring, y,1)) then
lnumbersonly = lnumbersonly + mid(pinstring,y,1)
else
if mid(pinstring,y,1) = "." then
lnumbersonly = ""
end if
end if
next
for x = 1 to len(lnumbersonly)
y = len(lnumbersonly) - x + 1
lnumbersonlyforward = lnumbersonlyforward + mid(lnumbersonly,y,1)
next
if lnumbersonlyforward = "" then lnumbersonlyforward = "0"
numbersonlynodecimals = lnumbersonlyforward
end function
上一篇: Python实现二叉搜索树
下一篇: JSP实现从不同服务器上下载文件的方法