All you do is use the Round command, and provide the number of decimal points to round it to. For example, if you have a number and want it to have only 2 decimals points so it looks like a dollar value, you would say -
Response.write "Your final total is: $" & Round(CartAmt,2) & " Dollars."
If you want to estimate the number of visitors you get in a given day based on your monthly traffic, you don't want to end up with partial visitors! So in this case you'd round to zero decimal points -
response.write "I get about " & Round(MonthVisit,0) & " visitors each day."
Numeric ASP Functions
Introduction to ASP Ebook Download this ebook to get everything you need to know about learning ASP - from a step by step tutorial to function lists, sample code, common errors and solutions, and much more! 101 pages. |