深圳升蓝软件
数据库开发 .Net技术  |  ASP技术 PHP技术 JSP技术 应用技术类   
Hiblue Software

怎样计算折扣


March 25,2004
<%@ 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>
       
Copyright © 2001-2008 Shenzhen Hiblue Software Team All rights reserved