limiting decimal places

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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 way to roud the number to 2 decimal places or just make it cut off after certain number of didgits. I don't think I can use anything in the properties box because they don't seem to display when called by asp program. I did this query Sum([person])/count(*) before the one above and set the properties to percent and it displayed fine in Access but when I used asp to display the wuery results it gave numbers like 0.1 instead of 10% I assume that the properties don't carry outside Access. Anyway any suggestions on how to accomplish either one of these problems will be appreciated. Thanks Matthew
 
One of the following will work. The "Fixed" constant may or may not be
understood by ASP:

Format(YourExpression,"Fixed")

Format(YourExpression,"#.00")
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

Matthew said:
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 way to roud the number to 2 decimal places or just make
it cut off after certain number of didgits. I don't think I can use
anything in the properties box because they don't seem to display when
called by asp program. I did this query Sum([person])/count(*) before the
one above and set the properties to percent and it displayed fine in Access
but when I used asp to display the wuery results it gave numbers like 0.1
instead of 10% I assume that the properties don't carry outside Access.
Anyway any suggestions on how to accomplish either one of these problems
will be appreciated. Thanks Matthew
 
Back
Top