当前位置:开发者网络 >> 技术教程 >> ASP教程 >> ASP技巧 >> 内容
精彩推荐
分类最新教程
分类热点教程
  
怎样计算折扣
作者:未知
日期:2003-04-17
人气:
投稿:Andy.m(转贴)
来源:未知
字体:
收藏:加入浏览器收藏
以下正文:
<%@ LANGUAGE = "VBScript"
ENABLESESSIONSTATE = False %>
<%
'Here we request the numeric percentages(%) of
'discount, ie: 2, 5, 10, 20, etc.:
percent_discount = "10"
'For multiplication, let's see if we need to
'add a zero after the decimal:
If Len(percent_discount) > 1 Then pd = "."&percent_discount&"" Else pd = ".0"&percent_discount&""
%>
<html>
<body>
<%
normal_cost = "50"
discounted_cost = normal_cost - (normal_cost * pd)
%>
Normal Cost: <%=FormatCurrency(normal_cost)%><br>
Discounted Cost: <%=FormatCurrency(discounted_cost)%>
</body>
</html>
相关文章: