TaxTotal Function:

The TaxTotal function adds sales tax to a US currency value. There are two required arguments: PreTaxAmount and SalesTaxPercentage. PreTaxAmount is a US Dollar value that the calculated tax should be added to. SalesTaxPercentage is the percentage representing sales tax. SalesTaxPercentage should not have the percentage sign (%) even though it represents a percentage. Example: For an 8.5% sales tax rate, SalesTaxPercentage expects the argument 8.5 .

Syntax:
currency = TaxTotal(PreTaxAmount, SalesTaxPercentage)
Example Usage:
<%
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
%>
ASP Source Code:
<%
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
%>