A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

limiting decimal places



 
 
Thread Tools Display Modes
  #1  
Old June 7th, 2004, 05:56 AM
Matthew
external usenet poster
 
Posts: n/a
Default 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  
Old June 7th, 2004, 10:27 AM
Arvin Meyer
external usenet poster
 
Posts: n/a
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:43 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.