程序討論版須知: 在使用老y文章管理系統中的一些問題!對非本程序方面的問題恕不解答!對Html,css等基礎問題恕不解答!如果沒有HTML基礎請先自學HTML! 需要打開你網站才能看出問題的請留下網址,并請保留本站版權及友情鏈接,否則不予回復。 |
|
![]() ![]() ![]() ![]()
|
樓主Time:2018/9/2 21:10:07 | |
![]() ![]()
|
管理員 變量能除以2 嗎?
管理員您好:
<td width="20%"><%If rs1("Sex")=1 then Response.Write("男") else Response.Write("<font color=red>女</font>") end if%></td> <td style="text-align:center;"><%=rs1("UserMoney")%></td> </tr> 研究了很久,發現很多都需要學習。 我現在 需要一個數值 是 <%=rs1("UserMoney")%> 除以2 的數字, 這函數怎么寫? 謝謝 是不是在 下面代碼修改: <% set rs1=server.createobject("ADODB.Recordset") sql1="select Top "&indexuser&" * from "&tbname&"_User Where yn=1 order by UserMoney desc,id desc" rs1.open sql1,conn,1,3 NoI=0 If Not rs1.Eof Then do while not (rs1.eof or err) NoI=NoI+01 %> 我最后需要的值是 <%=rs1("UserMoney")%> 除以2 的數 |
[Top] |
2 樓Time:2018/9/2 21:16:08 | |
![]() ![]()
|
RE:管理員 變量能除以2 嗎?
直接除就行<%=rs1("UserMoney")/2%>
這樣可能有小數,如果要取整,加個int即可,即<%=int(rs1("UserMoney")/2)%> |
[Top] |
3 樓Time:2018/9/3 8:40:45 | |
![]() ![]()
|
RE:管理員 變量能除以2 嗎?
感謝管理員!問題解決了 謝謝。
|
[Top] |
4 樓Time:2018/9/3 11:49:57 | |
![]() ![]()
|
RE:管理員 變量能除以2 嗎?
管理員 這個代碼 <%=mymoney%> 我按照您的方法 調試很多次出錯。 請指教哈, 我問題問完了,謝謝您!!
|
[Top] |