Decimal Places

eYeeYe Member Posts: 168
We recently encountered a problem where the user wants to see 3 decimal places on some field. When Navision do calculations on the field(s) in some cases, when using the debugger you notice that a logical test eg. IF a = b THEN will fail where say a = 3.526 and b = 3.526 . The developer that worked on it had to put rounding in almost everywhere the field was used to ensure the correct value is used.

Now my problem is that a new client wants the rounding precision of the qty to vary from item to item, and measuring device to measuring device.

If this requirement has to be implemented, I thought of maybe setting the qty.DECIMALPLACES = 2:5, and then do rounding to the desired precision.

Any recommendations?
Kind Regards,
Ewald Venter

Comments

  • krikikriki Member, Moderator Posts: 9,110
    This is the way I would do it.
    With 2:5 you ALWAYS see 2 decimals and if you have more decimals, you will see up to 5.
    So I would say:go ahead (if your customer really wants it).
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • dynuserdynuser Member Posts: 48
    With the rounding precision on the item card, can't this requirement be fulfilled?
  • dynuserdynuser Member Posts: 48
    kriki wrote:
    This is the way I would do it.
    With 2:5 you ALWAYS see 2 decimals and if you have more decimals, you will see up to 5.
    So I would say:go ahead (if your customer really wants it).
    Hi Kriki,
    By defining Rounding Precisions (as 1) on the item card, the quantity will be rounded to the next whole number. Similarly we can define the rounding precision as 0.01 for having 2 decimal places. Am I right?
  • krikikriki Member, Moderator Posts: 9,110
    correct.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.