ROUND, default behaviour

eCodeeCode Member Posts: 12
I have a strange problem with function ROUND. When I use it without any parameters like ROUND(Amount) and Amount has a value 17.75, it returns 18, but in other db it returns 17.75. Both db's are 5.0 runing Sql Server 2005. Does anybody know, where you can change ROUND function default behaviour? Value 17.75 is what I need.

Comments

  • kinekine Member Posts: 12,562
    Check the online help for the round function. The default value for rounding is derived from G/L Setup. :wink:
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • eCodeeCode Member Posts: 12
    Thanks for answering. I have checked G/L setup values, both db's has exactly the same values.

    This problem occurs in codeunit 12

    IF "Additional-Currency Posting" = "Additional-Currency Posting"::None THEN BEGIN
    IF Amount <> ROUND(Amount,Currency."Amount Rounding Precision") THEN
    FIELDERROR(
    Amount,
    STRSUBSTNO(Text000,Amount));
    IF "Amount (LCY)" <> ROUND("Amount (LCY)") THEN // here return should be 17.75, but it returns 18
    FIELDERROR(
    "Amount (LCY)",
    STRSUBSTNO(Text000,"Amount (LCY)"));
    END;
  • kinekine Member Posts: 12,562
    online help:
    ----
    The default value is 0.01 for the US version. In other countries/regions, other default values may be used. Note that the default value is only used when you have not specified the rounding precision in the Amount Rounding Precision field in the General Ledger Setup table.
    ----

    Which value you have in field "Amount Rounding Precision" in G/L Setup table (for both DBs)?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • eCodeeCode Member Posts: 12
    Value of "Amount Rounding Precision" is 0,01.
  • eCodeeCode Member Posts: 12
    "Solved". When I did backup/restore this behaviour dissappeared. I did not changed anything in DB. Strange!
Sign In or Register to comment.