How to get At least 2 decimal places without rounding the number

jhanvincent14
Member Posts: 214
all i want is to 0.11 to display at "COGS Percentage" but instead it displays 0.12 (see attached photo)
All help will be appreciated
All help will be appreciated

0
Answers
-
You have to use ROUND function for the variable vdecimal and then assign it to COGS.
Check https://msdn.microsoft.com/en-us/library/dd301418.aspx to know about using ROUND.0 -
If you want more than 2 decimal places on a field (which is what I think you are asking) then you need to clear the AutoFormatType property (if set) and set the DecimalPlaces property to 5:5 - to format to 5 decimal places for example.
Note you can only format up to 5 decimal places in a field in NAV, you can ream more about this property here...
https://msdn.microsoft.com/en-us/library/dd338809(v=nav.90).aspx0 -
You should problay use:
ROUND(VALUE,0.1,'<');
0 -
You don't have a rounding problem here in the first place. There is no (usual) way to round 0.1984... to the shown value of 0.12 . Rounding to two decimal places would give 0,20 .
By the way, your code is prone to division by zero error.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