Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Decimal places

Status
Not open for further replies.

sinistapenguin

Technical User
Jan 21, 2004
31
GB
Hi all

I have done a very basic calculation:

strDriverPay=(strNetTotal/100)*strDriverPayRate

This basically calculates how much to pay a delivery driver based on a percentage (strDriverPayRate) of the sales invoice he delivered.

The problem is that sometimes that when I display the result:

<%= "£" & strDriverPay%>

I sometimes get £1234.567890

Does anyone out there know how to limit the answer to 2 decimal places? ie. 1234.57??

Thanks

Sinista
 
this is an example of the syntax using the round function

<% response.write(round(request.form('txtSubTotal')/11, 2)) %>


Dodge20
 
also, use your DB to set the data /field format to round up numers (strNetTotal and strDriverPayRate) used in the calculation
...then use the "Round" as suggested by dodge20

> need more info?
:: don't click HERE ::
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top