asp代码小数四舍五入问题

来源:百度知道 编辑:UC知道 时间:2024/09/28 08:30:40
代码如下,出来的是详细到不限小数位数的结果
<%
n(m)=0
for f=1 to j
set Rs=server.createobject("adodb.recordset")
rs.open "select sum(use_Amount) from In_Store where supplier='"&names(m)&"' and class='"&cla(f)&"' and (uptime between #"&end_time&"# and #"&end_time1&"#) group by Supplier",conn,1,1
if not rs.eof then
num(m,f)=rs(0)
n(m)=n(m)+num(m,f)
%>
<td width="60" align="right" bgcolor="#FFFFFF"><font color="#CC3300"><%=num(m,f)%> </td>
<%
else
num(m,f)=0
%>
<td width="60" align="right" bgcolor="#FFFFFF"><%=num(m,f)%> </td>
<%
end if
rs.close
set rs=nothing
next
%>
怎么改到显示2位小数或3位小数的结果呢
请直接在我的代码上修改

<%
n(m)=0
for f=1 to j
set Rs=server.createobject("adodb.recordset")
rs.open "select sum(use_Amount) from In_Store where supplier='"&names(m)&"' and class='"&cla(f)&"' and (uptime between #"&end_time&"# and #"&end_time1&"#) group by Supplier",conn,1,1
if not rs.eof then
num(m,f)=rs(0)
n(m)=n(m)+num(m,f)
%>
<td width="60" align="right" bgcolor="#FFFFFF"><font color="#CC3300">
<%
p=num(m,f)
q=z=Round(p, 2)
response.write q&","
%></td>
<%
else
num(m,f)=0
%>
<td width="60" align="right" bgcolor="#FFFFFF">
<%
p=num(m,f)
q=z=Round(p, 2)
response.write q&","
%>
</td>
<%
end if
rs.close
set rs=nothing
nex