繁体中文
设为首页
加入收藏
当前位置:ASP技术首页 >> ASP技巧 >> 怎样计算折扣

怎样计算折扣

2004-10-01 08:26:10  作者:  来源:互联网  浏览次数:38  文字大小:【】【】【
简介:<%@ LANGUAGE = "VBScript" ENABLESESSIONSTATE = False %> <% 'Here we request the numeric percentages(%) of 'discount, ie: 2, 5, 10, 20, etc.: percent_discount = "10" 'F...
关键字:折扣 怎样

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

%>

<%

normal_cost = "50"

discounted_cost = normal_cost - (normal_cost * pd)

%>

Normal Cost: <%=FormatCurrency(normal_cost)%>

Discounted Cost: <%=FormatCurrency(discounted_cost)%>

责任编辑:admin
相关文章