Decimal places displayed on forms & reports

eYeeYe Member Posts: 169
I have a requirement that the amount of decimal places that should be displayed on forms and reports should be set.

On forms you can use the DECIMALPLACESMIN property on controls, but not on reports.

What I can do is put the decimal value in a string, determine the amount of decimal places and round or add zero's as required. But is there no quicker way?
Kind Regards,
Ewald Venter

Answers

  • krikikriki Member, Moderator Posts: 9,118
    There is a field-property "DecimalPlaces". Check that one. E.g. 2:2 always shows 2 decimals.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Miklos_HollenderMiklos_Hollender Member Posts: 1,598
    Are you sure it's Navision? Both on forms and reports there is a DecimalPlaces property on controls and no such thing as DecimalPlacesMin.
  • WaldoWaldo Member Posts: 3,412
    AFAIK you can use the property "DecimalPlaces" on a textbox control.

    What you should put into it (examples):

    1
    A minimum of 1 and a maximum of 1 decimal place
    1:4
    A minimum of 1 and a maximum of 4 decimal places
    2:
    At least 2 decimal places
    :2
    No more than 2 decimal places

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • eYeeYe Member Posts: 169
    I know of the decimalplaces property, the problem is that the amount of decimal places is variable.

    And yes, it is Navision.

    On your forms, give a textbox a name, you go to your symbol menu (F5), goto CurrForm, controls, choose your control, press Ctrl+(right arrow). This will give you something like this: CurrForm."txtBox".DECIMALPLACESMIN

    OK, technically it's a function not a property, sorry.

    Using this, you can set the decimal places to show in code.
    Kind Regards,
    Ewald Venter
  • WaldoWaldo Member Posts: 3,412
    they you can use the FORMAT() function with parameter:

    <Precision,2:3>

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • eYeeYe Member Posts: 169
    Ahhh..

    Thanks!

    FORMAT(2.233,0 ,'<Precision,5:5><Standard Format,0>')

    will give: 2.23300
    Kind Regards,
    Ewald Venter
Sign In or Register to comment.