web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Is Bankers Rounding used in NAV?

(0) ShareShare
ReportReport
Posted on by 3,079

Dynamics CRM uses Bankers Rounding for currency - basically whenever the relevant digit is a 5, sometimes it rounds up and sometimes down so things aren't always skewed one way or the other.  Post with more details here:  https://community.dynamics.com/crm/b/crmpowerobjects/archive/2013/09/23/rounding-numbers-in-microsoft-dynamics-crm

Does NAV do the same, or not?  It seems like it would, since 1. that's a built-in .NET functionality, and 2. you'd think MS products would be consistent, but I haven't been able to find clear documentation one way or the other.  I was able to find definitive documentation that quantities where the relevant digit is 5 would always be rounded up, but nothing about currency amounts.

Can anyone confirm?  And does anyone that uses both systems have any insight, if they do both do the rounding differently?  It's obviously a minor amount, but still...you don't want these weird floating pennies being different.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Alex A Profile Picture
    2,913 on at

    Hi Allison,

    I think NAV does it the same way. I've seen instances in NAV while validating custom queries where sales amounts that have a 5 in the decimal place gets rounded up and other instances where a 5 in the decimal place gets rounded down, and until I read the link you posted I hadn't figured out what the logic was for this... but now it makes sense.

  • keoma Profile Picture
    32,729 on at

    for rounding in NAV C/AL function ROUND is used:

    NewNumber := ROUND(Number [, Precision] [, Direction])

    mostly used in code like e.g. ROUND(DecValue, 0.01), ROUND(DecValue, 0.00001).

    Direction can be =, <, >. Seldom used, default is =. That means >=5 goes up, <5 goes down.

    for details about precision and round up/down follow msdn.microsoft.com/.../dd301418(v=nav.80).aspx

    many precision settings are located in G/L Setup:

    for details follow moxie4nav.wordpress.com/.../setting-up-precisions

  • awalters Profile Picture
    3,079 on at

    Jonathan - right, but that function description just talks about decimal numbers, not specifically currency (which is often handled differently).  We just did some more tests, and like Alex, we appear to be seeing the Bankers Rounding (also called Gaussian Rounding or Round-to-Even, for people searching for this later) behaviour in those instances where currency figures have a 5 in the 3rd precision spot - i.e. 1.115 rounds to 1.12 and 1.125 also rounds to 1.12.

    This seems to be consistent with CRM, but I was just really surprised to not find it in the documentation anywhere other than the link you mention above, which doesn't say whether it applies to currency, so was curious what other people had experienced, or found in documentation.

  • Alexander Ermakov Profile Picture
    28,096 on at

    It is also a matter of setup for the rounding. If you would open the currency card, it has a special Rounding pane, where user can define Invoice Rounding Type with the options of Nearest, Up and Down, and also specify Invoice rounding precision and other rounding options.

    msdn.microsoft.com/.../hh168566(v=nav.90).aspx

  • awalters Profile Picture
    3,079 on at

    Alexander - sorry, I should clarify.  We have those set - we're currently talking specifically about the case when the rounding type is nearest.  When it's set to nearest, and the relevant digit is 5, how does it behave?

    Interestingly, we just did more tests on a quantity field (assuming that the documentation above re: the digit=5 case was only for non-currency numbers), and found that the Bankers Rounding seems to apply there as well.  So with a precision of 2, we did 1.115 /10, and 1.125 / 10, and got 1.12 for both of these.  Which is actually inconsistent with that link, where it says that >= 5 will always round up.

    Anyone else seeing this behaviour other than us and Alex?

  • Alexander Ermakov Profile Picture
    28,096 on at

    Allison, thanks, now I've got your point. Quite interesting!I had actually not been noticing the cases when figures in 5 are rounded down at certain cases, but I'll check with different instances and figure out the behavior.

  • Verified answer
    Jens Glathe Profile Picture
    6,092 on at

    Oh there is some binary nastiness behind it, as far as I know. It is in the representation of floats in the IEEE-754 format. After all, it's a discrete value. It can introduce rounding"oddities" when the result, limited to what can be stored in the float format, is on the wrong side of a rounding rule. Please see here: community.dynamics.com/.../124340

    Additionally, there are some issues with rounding "chains" in NAV. Please see here: forum.mibuso.com/.../total-incl-vat-rounding-in-nav-2013-r2

    with best regards

    Jens

  • awalters Profile Picture
    3,079 on at

    Wow - that seems crazy that something as simple as rounding to 2 decimal places might not happen correctly.  It does seem consistent from instance to instance, though - so what would govern what happens when?  The bankers rounding seemed like a consistent way for it to work (and what at least a couple of us have witnessed), but you're saying it's not governed by rules that consistent, but by some weird processor quirk?  That's kind of unreal to me...

    Also, I'm astonished that there isn't any official documentation on this.  That's what I was really hoping to find, was just some official statement on how it was expected to work...:-(

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
HoangNam Profile Picture

HoangNam 7

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans