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
0
Answers
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
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
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.
Ewald Venter
<Precision,2:3>
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
Thanks!
FORMAT(2.233,0 ,'<Precision,5:5><Standard Format,0>')
will give: 2.23300
Ewald Venter