If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
limiting decimal places
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
|
#2
|
|||
|
|||
limiting decimal places
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" wrote in 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 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 |
Thread Tools | |
Display Modes | |
|
|