小數點前面是0不顯示,辛苦老師幫忙看看
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%Server.ScriptTimeOut=120%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%if InStr(lcase(Request.ServerVariables("http_user_agent")),"mobile")>0 or InStr(lcase(Request.ServerVariables("http_user_agent")),"phone")>0 then %>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<%end if%>
<title><%=session("dwmc")%><%=session("xtmc")%></title>
<style type="text/css">
<!--
body {
background-image: url(images/chaxiu.jpg);
}
-->
</style>
</head>
<script type="text/javascript">
function closewin(){
window.opener=null;
window.close();
}
function zh(){
if (document.form2.dangqianye.value != "1" )
{
document.form2.dangqianye.value = "1" ;
document.form2.submit();
}
}
function zq(){
if (document.form2.dangqianye.value != document.form2.zongyeshu.value)
{
document.form2.dangqianye.value = document.form2.zongyeshu.value;
document.form2.submit();
}
}
function hyc(){
if (parseInt(document.form2.dangqianye.value) > 1)
{
document.form2.dangqianye.value = String(parseInt(document.form2.dangqianye.value) - 1);
document.form2.submit();
}
}
<!--#include file="email.asp"-->
function qyc(){
if (parseInt(document.form2.dangqianye.value) < parseInt(document.form2.zongyeshu.value))
{
document.form2.dangqianye.value = String(parseInt(document.form2.dangqianye.value) + 1);
document.form2.submit();
}
}
<!--#include file="jiami.asp"-->
function xz(){
if (document.form2.dangqianye.value != document.form2.select.value )
{
document.form2.dangqianye.value = document.form2.select.value;
document.form2.submit();
}
}
<!--#include file="shop.asp"-->
//document.getElementById("daxiao").width=screen.availWidth;
</script>
<body>
<%
'On Error Resume Next
if session("chaxunhao")="" then response.Redirect("index.asp")
if Request.QueryString("dangqianye")<>"" then dangqianye=CInt(trim(Request.QueryString("dangqianye"))) else dangqianye=1
'if year(now) >= 2017 and int(rnd()*100)>flagx then response.End()
%>
<%if session("jmbzbz")=false then response.End()%>
<form name="form2" method="get" id="form2" action="<%=mid(Request("URL"),InStrRev(Request("URL"),"/")+1)%>">
<table id="daxiao" border="0" style="page-break-inside:avoid">
<tr>
<td align="center" valign="middle"> 選擇年月份:
<select name="select" onChange="xz()">
<%
if session("yuanlaifenzu") <> "" then
xgsj1=cdate(session("fenzuxiugaishijian"))
sql="Select * From excel where ( 所屬分組 ='"&session("fenzu")&"' and 上傳時間 > #"&xgsj1&"#) or ( 所屬分組 ='"&session("yuanlaifenzu")&"' and 上傳時間 < #"&xgsj1&"#) or 所屬分組 ='全部' ORDER BY id DESC"
else
sql="Select * From excel where 所屬分組 ='"&session("fenzu")&"' or 所屬分組 ='全部' ORDER BY id DESC"
end if
Set db = Server.CreateObject("ADODB.Connection")
%><!--#include file="db.asp"--><%
set rs = server.CreateObject("adodb.recordset")
rs.open sql,db,1,1
session("filenumbers")=rs.RecordCount
for i=1 to session("filenumbers")
shuoming=rs("檔案說明")
suoshufenzu=rs("所屬分組")
if i=dangqianye then
Response.Write("<option value='"&CStr(i)&"' selected>"&CStr(shuoming)&"("&suoshufenzu&")</option>")
filename=rs("檔案名")
session("excelbanben")=rs("excel版本")
else
Response.Write("<option value='"&CStr(i)&"'>"&CStr(shuoming)&"("&suoshufenzu&")</option>")
end if
rs.movenext
next
rs.close
set rs=nothing
db.Close
Set db=Nothing
%>
</select>
</td>
</tr>
<%if session("filenumbers")=0 then
Response.Write("<tr><td>對不起,沒有您的資料資訊 </td></tr>")
Response.End()
end if
%>
<%if session("kzqx")= true then %>
<%
strAddr = Server.MapPath(".\Database\"&filename)
set excel=server.createobject("adodb.connection")
%><!--#include file="excel.asp"--><%
set rs=server.CreateObject("adodb.recordset")
Sql="Select "&session("cxm")&" From [Sheet1$]"
rs.open Sql,excel
select case rs(session("cxm")).type
case 202 '字符型
cxm_str= "'"&session("chaxunhao")&"'"
case 8 '字串型
cxm_str= "'"&session("chaxunhao")&"'"
case else
cxm_str= session("chaxunhao")
end select
rs.close
Sql="Select * From [Sheet1$] where "&session("cxm")&" = "&cxm_str
rs.open Sql,excel
%>
<tr>
<td align="center">
<%if not (rs.bof and rs.eof) then %>
<table width="100%" border="1" align="center">
<% For j=0 To rs.Fields.Count-1%>
<tr><th><%=rs.Fields(j).Name%></th>
<% do
curValue = rs.Fields(j).Value
if curValue<>"" then
Response.Write("<td>"&curValue&"</td>")
else
Response.Write("<td> </td>")
end if
rs.movenext
loop while( not rs.eof)
rs.movefirst
%>
</tr>
<%next%>
</table>
<% else %>
<table width="100%" height="50" border="1" align="center">
<tr>
<td align="center" valign="middle" class="style1"> 您沒有此項<%=session("sjmc")%></td>
</tr>
</table>
<%end if%>
</td>
</tr>
<%
rs.close
set rs=nothing
excel.Close
Set excel=Nothing
%>
<%else%>
<%
dim a()
strAddr = Server.MapPath(".\Database\"&filename)
set excel=server.createobject("adodb.connection")
%><!--#include file="excel.asp"--><%
set rs=server.CreateObject("adodb.recordset")
Sql="Select "&session("cxm")&" From [Sheet1$]"
rs.open Sql,excel
select case rs(session("cxm")).type
case 202 '字符型
cxm_str= "'"&session("chaxunhao")&"'"
case 8 '字串型
cxm_str= "'"&session("chaxunhao")&"'"
case else
cxm_str= session("chaxunhao")
end select
rs.close
Sql="Select * From [Sheet1$] where "&session("cxm")&" = "&cxm_str
rs.open Sql,excel,1%>
<%if not (rs.bof and rs.eof) then %>
<tr>
<td align="center">
<%ReDim a(rs.Fields.Count-1)
For i=0 To rs.Fields.Count-1
flag = false
do
if rs.Fields(i).Value <> "" then
flag = true
exit do
end if
rs.movenext
loop while( not rs.eof)
a(i) = flag
rs.movefirst
next
%>
<table width="100%" border="1" align="center">
<% For j=0 To rs.Fields.Count-1
if a(j) = true then%>
<tr><th><%=rs.Fields(j).Name%></th>
<% do
curValue = rs.Fields(j).Value
if curValue<>"" then
Response.Write("<td>"&curValue&"</td>")
else
Response.Write("<td> </td>")
end if
rs.movenext
loop while( not rs.eof)
rs.movefirst%>
</tr>
<%end if%>
<%next%>
</table>
<% else %>
<table width="100%" height="50" border="1" align="center">
<tr>
<td align="center" valign="middle" class="style1"> 您沒有此項<%=session("sjmc")%></td>
</tr>
</table>
<%end if%>
</td>
</tr>
<%
rs.close
set rs=nothing
excel.Close
Set excel=Nothing
%>
<%end if%>
<tr>
<td>
<table width="100%" border="0">
<tr>
<input name="dangqianye" type="hidden" id="dangqianye" value="https://bbs.csdn.net/topics/">
<input name="zongyeshu" type="hidden" id="zongyeshu" value="https://bbs.csdn.net/topics/" style="font-size:12px">表格橫排</a> <a href="https://bbs.csdn.net/topics/mima.asp" style="font-size:12px">修改密碼</a> <a href="https://bbs.csdn.net/topics/quit.asp" style="cursor:pointer; font-size:12px">退出系統</a></td>
</tr>
</table>
</form>
</body>
</html>
uj5u.com熱心網友回復:
FormatNumber(0.222,0,-1,0,0)第二個引數-1就是顯示小數點前面的0
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/133072.html
標籤:ASP
上一篇:對于前端 大型門戶構建 ,前端架構,vue、nodeJs
下一篇:CSS浮動--float屬性決議
