Missing Zero

SudsSuds Member Posts: 22
I'm new to NAV and I'm having trouble with a field in a Sales Invoice Report. The field that should display the unit price seems to cut off the zero at the end of the price. When it is a complete dollar ($43.00) it even cuts off the decimal ($43). I've searched around and seen posts about the SourceExpr but don't even know where to go to see what the settings for those properties.

Any help or guidance would be much obliged. Thanks in advance.

Suds

Answers

  • matttraxmatttrax Member Posts: 2,309
    It is likely being displayed using FORMAT. When a number is formatted, and the type is not specified, it will cut off as many decimal places as it can while still retaining the same number. Take a look at the "Format Property" option under the Help Menu (the developer help, not the NAV application help) in the NAV client.
  • SogSog Member Posts: 1,023
    Look for decimalplaces in the helpfile.
    Probably you'll want to place them at "2:2" where the first 2 is minimum number of decimal places and the second one the maximum number.
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • SudsSuds Member Posts: 22
    it may seem obvious, but i'm not sure where this helpfile is nor the Format Property. I searched through the help menu in the developer as well as the report itself and didn't find the property.
  • DenSterDenSter Member Posts: 8,307
    On the Help menu, select C/SIDE Reference Guide
  • SudsSuds Member Posts: 22
    Thanks for the help everyone.

    I finally solved the issue by using
      IF Quantity = 0 THEN
        "Unit Price" := 0  // so it won't print
      ELSE
         "Unit Price" := ROUND((AmountExclInvDisc + "Line Discount Amount") / Quantity ,0.01);
    END;
    

    my issue now is the numbers printed don't have commas (,) every third digit (ex: 1,000,000,000.00)

    any help would be great
  • matttraxmatttrax Member Posts: 2,309
    Take a look at the FORMAT function. You can dictate how you want the numbers displayed.
  • rkuchar2014rkuchar2014 Member Posts: 6
    Hi,

    I had this issue in NAV 2013 yesterday. I made the following changes which resolved it:

    1.) in the "format" property of the field in Visual Studio I typed n2 (see link here for list of formats) http://dynamicsuser.net/blogs/mark_brum ... -rdlc.aspx

    2.) I right clicked on the field and went to the expression properties and added the code highlighted in red.

    =Code.BlankZero(CDec(Choose(25,Split(Cstr(ReportItems!Stub1_LineAmount.Value),Chr(177)))))


    Now the report prints all decimals even if it is .00 :mrgreen:

    Hope this helps someone.
Sign In or Register to comment.