操作系统 程序设计 图形图像 媒体动画 机械电子 WEB开发 数据库 办公软件 路由技术 网络原理 网络架设 网络管理 认证培训
您的位置:计算机资讯网 >> WEB开发 >> ASP >> ASP技巧 -> 怎样计算折扣
怎样计算折扣
2004-10-14 11:38:16
>


<%@ 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>

转自:不详 作者:未知 关闭
加入收藏 推荐给好友 打印本文
内容为网上收集,并不代表本站同意或者赞同其观点,如果有任何版权,内容问题,请联系本站,我们将在第一时间处理.
查询
关键字
搜索范围
热点专题
服务
计算机资讯网 | 联系方式 | 广告服务 | 意见留言 | 友情链接 | 网站地图 | 设为首页