Rounding on Item Attribute of type Decimal

johnnyp
Member Posts: 14
Hello.
I hope some can help me with this question about Item Attributes and the weird rounding of attribute type Decimal.
For starters, we are using Dynamics NAV 2017. I created an Item attribute of type Decimal. Then I added it to an Item and entered value 1000. I closed the Attributes window and reopened it, and the value was 1. I entered 1.000 with the same result, as 1.000,00 and 1000,00
I tried entering 10000, closed the window and reopened it, and the value was 10. Same hapened when I entered 100000, only the value was set to 100. It looked like it divided entries by 1000, however when I entered 1000000 it stored it as 1000000. Weird right? Some other numbers: 3400 rounded to 3,4. 250 not rounded. 34000 rouned to 34.
If anyone understands what the heck I'm talking about, I would greatly appreciate an explanation.
Best regards, John
I hope some can help me with this question about Item Attributes and the weird rounding of attribute type Decimal.
For starters, we are using Dynamics NAV 2017. I created an Item attribute of type Decimal. Then I added it to an Item and entered value 1000. I closed the Attributes window and reopened it, and the value was 1. I entered 1.000 with the same result, as 1.000,00 and 1000,00
I tried entering 10000, closed the window and reopened it, and the value was 10. Same hapened when I entered 100000, only the value was set to 100. It looked like it divided entries by 1000, however when I entered 1000000 it stored it as 1000000. Weird right? Some other numbers: 3400 rounded to 3,4. 250 not rounded. 34000 rouned to 34.
If anyone understands what the heck I'm talking about, I would greatly appreciate an explanation.
Best regards, John
0
Best Answer
Answers
-
Hi John
I modified the solution, as it is error prone to culture. As I remember it’s due to not all functions in the solution being culture independent in handling decimal.
I modified it a few places to always evaluate to XML.
It’s because the value field in attribute is text, to be generic.Follow me on my blog juhl.blog0 -
Thank you Juhl, but I'm afraid I don't quite understand what you mean.0
-
Check the table object and see if there is any code in OnValidate. Just a plain decimal field should not behave like that0
-
Oh, It's a text field? I thought that table 7501 stores texts in field "Value" and numbers in field "Numeric value" ... maybe i'm getting this all wrong.0
-
A, yes, now I understand. Thank you for the explanation.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