当前位置:雨林木风下载站 > 网页设计教程 > 详细页面

一个容易但是实用的小函数,asp的

一个容易但是实用的小函数,asp的

更新时间:2025-12-22 文章作者:未知 信息来源:网络 阅读次数:

大家在做某种数据显示的时候是不是经常遇到这样的情况,太大的数字显示成科学计数法,而比小数则显示成.555这样,非常不美观,可以用以下小函数搞它function sonic(tnum)if csng(...
大家在做某种数据显示的时候是不是经常遇到这样的情况,太大的数字显示成科学计数法,而比小数则显示成.555这样,非常不美观,可以用以下小函数搞它
function sonic(tnum)
if csng(tnum)>0 then
getlar=0

if instr(tnum,"E")>1 then
tnum=tnum/10000
getlar=1
else
if instr(tnum,".")<1 then
tnum=cstr(tnum)&"."
end if
if instr(tnum,".")=1 then
tnum="0"+cstr(tnum)
end if
end if
if getlar=0 then
 sonic=left(tnum&"00",instr(tnum,".")+2)
else
 sonic=left(tnum&"00",instr(tnum,".")+2)+"万"
end if
elseif csng(tnum)<0 then
tnum=-csng(tnum)
if instr(tnum,".")<1 then
tnum=cstr(tnum)&"."
end if
if instr(tnum,".")=1 then
tnum="0"+cstr(tnum)
end if
sonic="-"&left(tnum&"00",instr(tnum,".")+2)
else
sonic="0.00"
end if
end function

很简单的哦

温馨提示:喜欢本站的话,请收藏一下本站!

本类教程下载

系统下载排行