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 » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

% calculated but not to two decimals



 
 
Thread Tools Display Modes
  #1  
Old November 17th, 2008, 06:31 PM posted to microsoft.public.access.forms
Ben
external usenet poster
 
Posts: 536
Default % calculated but not to two decimals

I have a very simple calculation
Percent = (i/j) *100
That works, but it doesn't expand to two decimals.

I want it to be something like 99.38%

How can I change the equation above to do that?

Thanks

Ben
  #2  
Old November 17th, 2008, 07:32 PM posted to microsoft.public.access.forms
Barry A&P[_2_]
external usenet poster
 
Posts: 119
Default % calculated but not to two decimals

Ben assuming its a control open properties for the control
Set Field size to decimal
Format to % or fixed depending on how the formula works
Precision 4 or 6 ( F1 for more info on this)
Scale 2
Decimal places 2

in the properties box select a property and hit F1 and a great description
of what the property does will be dispayed.

Cheers


"Ben" wrote:

I have a very simple calculation
Percent = (i/j) *100
That works, but it doesn't expand to two decimals.

I want it to be something like 99.38%

How can I change the equation above to do that?

Thanks

Ben

  #3  
Old November 17th, 2008, 08:29 PM posted to microsoft.public.access.forms
fredg
external usenet poster
 
Posts: 4,386
Default % calculated but not to two decimals

On Mon, 17 Nov 2008 10:31:01 -0800, Ben wrote:

I have a very simple calculation
Percent = (i/j) *100
That works, but it doesn't expand to two decimals.

I want it to be something like 99.38%

How can I change the equation above to do that?

Thanks

Ben

How about....

=Format((i/j)*100,"#.00")
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
  #4  
Old November 20th, 2008, 12:35 AM posted to microsoft.public.access.forms
Bob Quintal
external usenet poster
 
Posts: 939
Default % calculated but not to two decimals

=?Utf-8?B?QmVu?= wrote in
:

I have a very simple calculation
Percent = (i/j) *100
That works, but it doesn't expand to two decimals.

I want it to be something like 99.38%

How can I change the equation above to do that?

Thanks

Ben


It's not the equation that needs changing, it's where (how) you are
storing the result. You are storing the value in a memory variable or
table field which is of integer (or long integder) type.
Change the storage to a double precision type and you will have as meny
decimals as you wish, which you can cut down to the 2 you want with a
format() function.


--
Bob Quintal

PA is y I've altered my email address.
** Posted from http://www.teranews.com **
 




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 05:48 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.