Unable to write decimals in quantity

marvinq
Member Posts: 69
Hi,
I have got a mysterious problem.
I have made a asp.net site which creates sales orders and lines in NAV. Everything works just perfect, until I tried to use decimals in my quantity. When decimals are used I get the message that the input string is not i the correct format.
My site is pretty much like this one:
http://blogs.msdn.com/b/freddyk/archive ... d-rtm.aspx
If I replace the following line I get the error...
line1.Quantity = 3;
replaced by:
line1.Quantity = decimal.Parse(tbQuantity.Text);
I have also tried in a more static way, to debug..
line1.Quantity = 3.3m;
..this just sets quantity to 33.
Why?? What is wrong?
I have got a mysterious problem.
I have made a asp.net site which creates sales orders and lines in NAV. Everything works just perfect, until I tried to use decimals in my quantity. When decimals are used I get the message that the input string is not i the correct format.
My site is pretty much like this one:
http://blogs.msdn.com/b/freddyk/archive ... d-rtm.aspx
If I replace the following line I get the error...
line1.Quantity = 3;
replaced by:
line1.Quantity = decimal.Parse(tbQuantity.Text);
I have also tried in a more static way, to debug..
line1.Quantity = 3.3m;
..this just sets quantity to 33.
Why?? What is wrong?
0
Comments
-
This is due to country-specific decimal notation.
I presume Denmark has a decimal notation similar to the Belgian one. With "." for seperation of thousands and "," for seperation of decimals.
It is best to save your send your quantity through as text and evaluate it with a decimal before putting it in the quantity field of your order.
a handy line of code is available for the conversion variables to replace are in []:
[MyparsableString] := CONVERTSTR([YourQuantityString],'.',DELCHR(FORMAT(0.1),'=','01')))
This part will get the country-specific decimal seperator: DELCHR(FORMAT(0.1),'=','01')
It will replace it with a '.' which in C/AL is always the decimal seperator0
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