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  

Round Function Problem



 
 
Thread Tools Display Modes
  #1  
Old October 1st, 2009, 11:13 AM posted to microsoft.public.access.forms
Anatoly Kurilin
external usenet poster
 
Posts: 21
Default Round Function Problem

Hi, the function Round in Microsoft Access returns 66.22 = Round(66.225, 2),
but the same function in Microsoft Excel returns 66.23. I'm really
embarrassed! What number is correct?



Thank in advance,

AK







  #2  
Old October 1st, 2009, 11:29 AM posted to microsoft.public.access.forms
Allen Browne
external usenet poster
 
Posts: 11,706
Default Round Function Problem

See:
http://allenbrowne.com/round.html#FloatingPointErrors

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"Anatoly Kurilin" wrote in message
...
Hi, the function Round in Microsoft Access returns 66.22 = Round(66.225,
2), but the same function in Microsoft Excel returns 66.23. I'm really
embarrassed! What number is correct?


  #3  
Old October 1st, 2009, 12:46 PM posted to microsoft.public.access.forms
Anatoly Kurilin
external usenet poster
 
Posts: 21
Default Round Function Problem

Dear Allen, thanks for the tip. Is it possible to make Microsoft Excel and
Access Round functions to return the same rounded number?

AK



"Allen Browne" wrote in message
...
See:
http://allenbrowne.com/round.html#FloatingPointErrors

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"Anatoly Kurilin" wrote in message
...
Hi, the function Round in Microsoft Access returns 66.22 = Round(66.225,
2), but the same function in Microsoft Excel returns 66.23. I'm really
embarrassed! What number is correct?




  #4  
Old October 1st, 2009, 01:19 PM posted to microsoft.public.access.forms
Allen Browne
external usenet poster
 
Posts: 11,706
Default Round Function Problem

It depends how the number is represented internally.

In Access you can use a fixed-point number (such as Currency) or a scaled
number (such as Decimal) if you want precision, but remember that the
Round() function in Access uses bankers rounding.

In Excel, you typically have less control over the data type (though you
could typecast), so I can't guarantee you the same results. The Round() in
Excel and in Access are quite different. For example, in Excel it works with
a negative number of decimal places (2nd argument), but this won't work at
all in Access.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"Anatoly Kurilin" wrote in message
...
Dear Allen, thanks for the tip. Is it possible to make Microsoft Excel and
Access Round functions to return the same rounded number?

AK



"Allen Browne" wrote in message
...
See:
http://allenbrowne.com/round.html#FloatingPointErrors

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"Anatoly Kurilin" wrote in message
...
Hi, the function Round in Microsoft Access returns 66.22 = Round(66.225,
2), but the same function in Microsoft Excel returns 66.23. I'm really
embarrassed! What number is correct?




 




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 06:21 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.