Hi all,
I am facing a problem with decimal round off.
The senario :
1. I have a feild which has the value say, 17.747462.
2. I want to return the value on 17.74. I was trying to use format function but not able to execute that properly.
N.B. I do not know the length of the number. But I want to take only 2 decimal places.
Please advice.
Thanks in Advance
Arindam
0
Comments
And you can use third parameter to tell NAV how to round the value ('<' down - truncate the rest, '>' up - rond always up, '=' nearest - common rounding...)
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
be smart before being a clever.
...
Using a standard format with an attribute:
<Precision,2:3><Standard Format,0> will use Standard Format 0 and will format the data with a minimum of 2 and a maximum of 3 decimal places. See also the DecimalPlaces property. If you do not specify any precision the form will use the precision specified in the Decimal Places property of the corresponding field in the table.
...
So if you want to show the number on a form (or a report) you can use format property like:
FORMAT(Value [, Length] [, FormatStr/Number])
where in the last optional parameter you enter <Precision,2:3><Standard Format,0>. In your case you would write <Precision,2:2><Standard Format,0> because u need only 2 decimal places. Of course you can put some other standard format instead of mentioned one.
I hope it helps you.
This is the problem ; I used CLEARAL on preXMLProt . I didnt notice this
I deleted it.It works correctly..
Thank you for your help
Here is the right one.
viewtopic.php?f=14&t=34291
and you are welcome.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n