<%
Dim BeforeTax, AfterTax, SalesTax
' sales tax is 8.5%
SalesTax = 8.5
' beforeTax is equal to the sum of the five
' items ( the total pre-tax amount )
' BeforeTax is equal to $6,506.11
BeforeTax = _
FormatCurrency( 300.00 + 25.23 + 5245.94 + 133.94 + 801.00 , 2 )
' afterTax is the total of BeforeTax with the calculated
' 8.5% rate added to the pre-tax amount
AfterTax = TaxTotal( BeforeTax, SalesTax )
' AfterTax returns: $7,059.13
Response.Write AfterTax
%>
<%
Private Function TaxTotal(byVal PreTaxAmnt, byVal PercentTax)
Dim pretax, pcttax, strout
pretax = FormatNumber( PreTaxAmnt, 2 )
pcttax = 1 + (PercentTax / 100)
strout = pretax * pcttax
strout = round(strout, 2)
TaxTotal = FormatCurrency( strOut, 2 )
End Function
%>