Try this:
This handy function below will round off numbers to two
decimal places (perfect for working with variables related
to currency values) however, if the resulting number only
has one digit following the decimal place, it doesn't
append a "0" to the end of the result.
For instance, if the number being rounded is "1.1231" the
result will be "1.12" but if the number to be rounded
is "1.2" then the result will be "1.2" where it should
be "1.20".
Any help achieving this would be grand.
Code:
function TwoDP(strNum)
Dim x
x = Instr(strNum,".")
TwoDP = Mid(strNum, 1, x + 2)
end function
http://forums.aspfree.com/showthread.php?t=26973
Bill Schroyer
(e-mail address removed)
http://www.frontpagewiz.com
-----Original Message-----
Hello, I have a database which has a query with a string
like Sum([person])/count(*)*100. When I go to display the
results of the query on my page it lools like this <%=rs
("person")%>% the only problem I am having is that when it
is not an even number of votes I get a really long decimal
number. Is there a simple way in asp to make the results
round to 1 decimal place or just cut it off after a
certain number of digits or is this a strictly MS Access
thing. Either way thanks for your help. Matt