Round decimal field in report

MortenSteengaard
Member Posts: 144
Hi experts!
I have a decimal field with 5 decimal digits, but on my report, I would like NAV 2009 to round or truncate the value to 2 digits (from 1.23456 to 1.23).
I have tried to set the property DecimalPlaces to "<2:2>" and "2:2", but it still shows too many decimal digits. When I print the value 42, it is shown nicely as "42.00".
How do I tell NAV to round or truncate the value?
I have a decimal field with 5 decimal digits, but on my report, I would like NAV 2009 to round or truncate the value to 2 digits (from 1.23456 to 1.23).
I have tried to set the property DecimalPlaces to "<2:2>" and "2:2", but it still shows too many decimal digits. When I print the value 42, it is shown nicely as "42.00".
How do I tell NAV to round or truncate the value?
0
Answers
-
Thanks a lot BlackTiger. I'll look into this next week.
I forgot to write that the report is made using the "Sections" and not "Layout". Is your answer still correct?0 -
Hi,
it's not quite clear what you want to achieve. First you sayMortenSteengaard wrote: »I would like NAV 2009 to round or truncate the value to 2 digits (from 1.23456 to 1.23).MortenSteengaard wrote: »it is shown nicely as "42.00"
I count those ".00" as two digits, just as you specified.
If you don't want those zeros at the end, you may use 0:2 as your value for the DecimalPlaces property. (The value means: round the value to two decimal places, then show at least zero and at most 2 digits after the decimal separator, removing trailing zeros)
NAV shows default values surrounded with angle backets (i.e. the <2:2>). You do not enter those, if you specify a value. In fact, in most cases this is an error.
You do not need to ROUND() your value, DecimalPlaces takes care of this (for display only, it does not alter the variable or field in SourceExpression).
0 -
Thank you - both of you!
If I write "round("Sales Line Archive"."Unit Cost (LCY)", 0.01)" in my SourceExpr, all lines are shown with two digits, just as I want. So the problem is solved!
But I still don't understand why NAV completely ignores what I enter in DecimalPlaces. I set my SourceExpr to ""Sales Line Archive"."Unit Cost (LCY)" and if my DecimalPlaces for example is set to "0:0", or "2:2" or "3:3" the result is always the same like this:
1.2345678
0.00
5.50
1234.567
I want that to be shown as:
1.23
0.00
5.50
1234.57
I am very new to NAV, so there is a lot of properties that I don't know what mean.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions