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  

Currency Field



 
 
Thread Tools Display Modes
  #1  
Old March 9th, 2010, 03:01 PM posted to microsoft.public.access.forms
Aurora
external usenet poster
 
Posts: 224
Default Currency Field

I am using Access 2003.
I have a form with a currency field that has 5 decimal points. This field
rounds up when I do not want it to. Ex: I put in $0.15768 and get $0.15770.
I trield to expand the field to 6 decimal points but it still rounded up.
How do I get this field to accept just the currency I put it and not round
up? I would appreciate any help you can give me.

Aurora
  #2  
Old March 9th, 2010, 03:18 PM posted to microsoft.public.access.forms
Stefan Hoffmann
external usenet poster
 
Posts: 991
Default Currency Field

hi Aurora,

On 09.03.2010 16:01, Aurora wrote:
I have a form with a currency field that has 5 decimal points. This field
rounds up when I do not want it to. Ex: I put in $0.15768 and get $0.15770.
I trield to expand the field to 6 decimal points but it still rounded up.
How do I get this field to accept just the currency I put it and not round
up? I would appreciate any help you can give me.

It's not possible as it has only 4 digits to the right:

http://msdn.microsoft.com/en-us/libr...ice.10%29.aspx

So you need either a Single or a Double field instead, but this depends
on your actual case (rounding is an issue here).


mfG
-- stefan --
  #3  
Old March 9th, 2010, 05:01 PM posted to microsoft.public.access.forms
Aurora
external usenet poster
 
Posts: 224
Default Currency Field

Thank you for responding. I am not sure what you mean when you said - "So
you need either a Single or a Double field instead, but this depends on
your actual case (rounding is an issue here)."

I understand that "rounding" is the issue. Is there anywhere to put in a
formula that states "do not round up"??

Aurora

"Stefan Hoffmann" wrote:

hi Aurora,

On 09.03.2010 16:01, Aurora wrote:
I have a form with a currency field that has 5 decimal points. This field
rounds up when I do not want it to. Ex: I put in $0.15768 and get $0.15770.
I trield to expand the field to 6 decimal points but it still rounded up.
How do I get this field to accept just the currency I put it and not round
up? I would appreciate any help you can give me.

It's not possible as it has only 4 digits to the right:

http://msdn.microsoft.com/en-us/libr...ice.10%29.aspx

So you need either a Single or a Double field instead, but this depends
on your actual case (rounding is an issue here).


mfG
-- stefan --
.

  #4  
Old March 9th, 2010, 05:15 PM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Currency Field

On Tue, 9 Mar 2010 07:01:01 -0800, Aurora
wrote:

I am using Access 2003.
I have a form with a currency field that has 5 decimal points. This field
rounds up when I do not want it to. Ex: I put in $0.15768 and get $0.15770.
I trield to expand the field to 6 decimal points but it still rounded up.
How do I get this field to accept just the currency I put it and not round
up? I would appreciate any help you can give me.

Aurora


The Currency datatype in Access is a scaled large integer, with exactly four
decimal places. If you use a Currency field, that's part of the cost: you only
get four, and you *cannot* tweak it, or reformat it, or display it to hold
more.

You may want to consider using a different datatype. I'd suggest a Number,
with a Field Size property of Decimal, a Precision large enough to handle the
largest value you'll encounter, and a Scale of 5 to store five decimals.

--

John W. Vinson [MVP]
  #5  
Old March 9th, 2010, 06:34 PM posted to microsoft.public.access.forms
Stefan Hoffmann
external usenet poster
 
Posts: 991
Default Currency Field

On 09.03.2010 18:01, Aurora wrote:
Thank you for responding. I am not sure what you mean when you said - "So
you need either a Single or a Double field instead, but this depends on
your actual case (rounding is an issue here)."

I understand that "rounding" is the issue. Is there anywhere to put in a
formula that states "do not round up"??

No. The problem is that Currency is an exact data type. It guarantees
accurate results in its 4-digit range. Using a Single or Double is
different. These are imprecise data types. Here you get rounding errors
due to the fact that computers cannot precisely calculate with these
kind of numbers.

When I say, it depends on the case, then I mean: What kind of values do
we have here? To which domain (range of values) do they belong? What
kind of arithmetic operations do we have to apply?


mfG
-- stefan --
  #6  
Old March 10th, 2010, 02:52 PM posted to microsoft.public.access.forms
Aurora
external usenet poster
 
Posts: 224
Default Currency Field

John:
Thank you so much for responding. I did what you said and it worked great.
Thank you for sharing your expertise. I really appreciate it.

Aurora

"John W. Vinson" wrote:

On Tue, 9 Mar 2010 07:01:01 -0800, Aurora
wrote:

I am using Access 2003.
I have a form with a currency field that has 5 decimal points. This field
rounds up when I do not want it to. Ex: I put in $0.15768 and get $0.15770.
I trield to expand the field to 6 decimal points but it still rounded up.
How do I get this field to accept just the currency I put it and not round
up? I would appreciate any help you can give me.

Aurora


The Currency datatype in Access is a scaled large integer, with exactly four
decimal places. If you use a Currency field, that's part of the cost: you only
get four, and you *cannot* tweak it, or reformat it, or display it to hold
more.

You may want to consider using a different datatype. I'd suggest a Number,
with a Field Size property of Decimal, a Precision large enough to handle the
largest value you'll encounter, and a Scale of 5 to store five decimals.

--

John W. Vinson [MVP]
.

 




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 09:15 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.