Round off amount

suraj92291
Member Posts: 49
Hello Experts,
Nav 2013R2 have function for rounding up amount or other decimal values in reports.So it will directly rounding up and display the amount.but i need to display round off amount which will add or subtract from the actual amount (please find attachment for same ).
any help will be greatly appreciated.
Thanks & Regards,
Suraj
Nav 2013R2 have function for rounding up amount or other decimal values in reports.So it will directly rounding up and display the amount.but i need to display round off amount which will add or subtract from the actual amount (please find attachment for same ).
any help will be greatly appreciated.
Thanks & Regards,
Suraj
“Any fool can know. The point is to understand.”
― Albert Einstein
― Albert Einstein
0
Answers
-
Hi,
From NAV helpRounds the value of a numeric variable.
NewNumber := ROUND(Number [, Precision] [, Direction])
Parameters
Number
Type: Decimal
The number that you want to round.
Precision
Type: Decimal
This optional parameter determines the precision used when rounding. If you do not specify a Precision parameter, then the following steps are used to specify the precision:
The function ReadRounding in Codeunit 1, Application Management, is called. ReadRounding returns a decimal value that is the precision. By default, the ReadRounding function returns the Amount Rounding Precision field from the GLSetup table.
If you have customized Codeunit 1 and it does not implement the ReadRounding function, then the No. of digits after decimal in the Regional and Language Options on the current computer is used to specify the precision. If the No. of digits after decimal does not specify a valid value, then the precision is specified as 2 digits after the decimal.
Direction
Type: Text or Code
This optional parameter specifies how to round the Number parameter. The default rounding method is '='. The following are the options for rounding:
'=' rounds up or down to the nearest value (default). Values of 5 or greater are rounded up. Values less than 5 are rounded down.
'>' rounds up
'<' rounds downDecimalToRound := 1234.56789; Direction := '>'; Precision := 0.001; Result := ROUND(DecimalToRound, Precision, Direction); MESSAGE(Text000, Format(DecimalToRound,0,1), Precision, Direction, Result);
I hope this helps.
Thanks.0 -
Maybe me, but can you not just do the following in Visual Studio:
Round(Fields!Amount.value)-Fields!Amount.value= You round amount.
/Claus LundstrømClaus Lundstrøm | MVP | Senior Product Manager | Continia.com
I'm blogging here:http://mibuso.com/blogs/clausl and used to blog here: http://blogs.msdn.com/nav
I'm also offering RDLC Report Training, ping me if you are interested. Thanks to the 700 NAV developers that have now already been at my training. You know you can always call if you have any RDLC report issues :-)0 -
“Any fool can know. The point is to understand.”
― Albert Einstein0
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