Multiplication of Dotnet double
jimmyf
Member Posts: 104
I have defined three dotnet variables of type system.double.
System.Double.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
How do I multiply these together? if I try and perform the following double1 := double2 * double3; I get the following error when compiling
Type conversion is not possible because one of the operators contains an invalid type. Dotnet * Dotnet
System.Double.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
How do I multiply these together? if I try and perform the following double1 := double2 * double3; I get the following error when compiling
Type conversion is not possible because one of the operators contains an invalid type. Dotnet * Dotnet
0
Answers
-
Hi,
I would suggest you retrieve the values in NAV decimal variables and then, do the math.
mydotnet1:=mydotnet1.dotnet1();
mydotnet2:=mydotnet2.dotnet2();
result1:=mydotnet1.operation1;
result2:=mydotnet2.operation2;
finalres:=result1*result2;
maybe like this?
0 -
Hi,
Try to run this code to understand what is happening:MESSAGE('%1', D1.Parse('0,5') * D2.Parse('8')); MESSAGE('%1\%2\%3', D1.Double, D2.Double, D1.Parse('1,5') * D2.Parse('2,0'));
P.S: you may need to adapt the decimal separator inside Parse('1,5').
But, why are you trying to do this? Why don't you use NAV decimals: System.Double is mapped to NAV Decimal:
https://msdn.microsoft.com/en-us/library/hh165619(v=nav.90).aspx
0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 611 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions

