最新下载
热门教程
- 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
很简单的哦
相关文章
- 原神玛薇卡暴力火伤队怎么玩 玛薇卡配队大全一览 07-12
- 星露谷物语星之果实怎么收集-星之果实全收集攻略 07-12
- 剑星艾米尔商店位置在哪里 位置分布一览 07-12
- 送礼物发朋友圈的文案 07-12
- 幻兽帕鲁霹雳犬在哪抓 帕鲁霹雳犬抓捕位置介绍 07-12
- 突破倒计时:顶尖交易员揭示以太坊的牛市布局 07-12