Formatting a field to five decimals in a page

poppinspoppins Member Posts: 647
edited 2018-02-14 in NAV Three Tier
Hi everyone,

I have a request from a customer to make the field Quantity display 5 decimals in page 99000846: Consumption Journal.
This page is based on table 83: Item Journal Line.
In the table, the field Quantity has the property DecimalPlaces = 0:5
How can I force it to display always 5 decimals in my page?
I tried changing the property DecimalPlaces to 5:5 in the page but it didn't work...


Thanks in advance :smile:

Comments

  • NavSolutionNavSolution Member Posts: 36
    For that you need Text Field There You Can use,
    FORMAT(5.55,0 ,'<Precision,5:5><Standard Format,0>')
    ->it Return 5.55000.

    on Page it only show 5 Decimal(Type-Decimal), If There Is Actual 5 Decimal Value.

    -->Note - Table Decimal property Allow to user For enter 5 Decimal Value Not For Showing (5 Zero)
  • NavSolutionNavSolution Member Posts: 36
    BlackTiger wrote: »
    For that you need Text Field There You Can use,
    FORMAT(5.55,0 ,'<Precision,5:5><Standard Format,0>')
    ->it Return 5.55000.

    on Page it only show 5 Decimal(Type-Decimal), If There Is Actual 5 Decimal Value.

    -->Note - Table Decimal property Allow to user For enter 5 Decimal Value Not For Showing (5 Zero)

    Actually format should be '<Sign,1><Integer Thousand><Decimals,6>'

    Both Work ,Check Format Syntax with Standard Format.
  • vaprogvaprog Member Posts: 1,139
    Using FORMAT has the disadvantage of adjusting the result left instead of right.
    Using ...<Decimals,6> has the disadvantage of showing ****** in some obscure cases when the actual value requires more than the specified number of decimals (5 in this case) e.g. 1.999999 is displayed as 1******

    I suggest using DecimalPlaces=5:5 and adding 0 to the value in the SourceExpression property. This, as do the other suggestions brought forth so far, causes the field to be non-editable.
    For an editable field you needed to use a variable as the SourceExpression and sync it with the field (OnAfterGetRecord, OnValidate), or define your own AutoFormatType. As an alternative to this define a foreign currency with the desired rounding and use it with one of the existing AutoFormatTypes 1 or 2.

    Also, please, complain to Microsoft about this 'feature'.

    @BlackTiger
    What's wrong about '<Precision,5:5><Standard Format,0>'?
Sign In or Register to comment.