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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|