最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
一个简单但是实用的小函数,asp的
时间:2022-07-02 23:53:47 编辑:袖梨 来源:一聚教程网
大家在做某种数据显示的时候是不是经常遇到这样的情况,太大的数字显示成科学计数法,而比小数则显示成.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
很简单的哦
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
很简单的哦
相关文章
- 爱看漫画-在线免费观看漫画入口-爱看漫画全网资源 12-23
- 火影忍者在线畅玩入口-2026火影忍者云游戏极速秒玩地址全收录 12-23
- 艾尔登法环黑夜君临遗物介绍:断裂编绳属性与获取方式详解 12-23
- 英雄没有闪什么职业厉害 强势职业及流派选择攻略 12-23
- 哔哩官网网页版直达入口-哔哩哔哩官网网页版在线访问 12-23
- 英雄没有闪秘法师技能搭配 主流流派技能组合攻略 12-23