ExcelBuffer and NumFormat

Ryden
Member Posts: 24
I'm having trouble with NumFormat while creating an Excel file
I'm looping a record and doing some calculations and then a second loop over time.
The results are written to ExcelBuffer with one line per record iteration and one column per time period
I got a request to reduce the number of decimals to two to enhance readabilty, so I passed '0.##' to the NumFormat parameter of CreateColumn as per Excel helpfile
This works for the first record iteration, all the columns get the correct value and number of decimals 1276,05733 shows as 1276,06 (In Sweden the dec. separator is a comma)
The following record iterations show the value as truncated to the first three figures with a period inserted after the first in all columns.
E.g. I get 4.42 instead of 441,838975.
Anyone have any ideas about this, and why does it work the first time round?
I'm looping a record and doing some calculations and then a second loop over time.
The results are written to ExcelBuffer with one line per record iteration and one column per time period
I got a request to reduce the number of decimals to two to enhance readabilty, so I passed '0.##' to the NumFormat parameter of CreateColumn as per Excel helpfile
This works for the first record iteration, all the columns get the correct value and number of decimals 1276,05733 shows as 1276,06 (In Sweden the dec. separator is a comma)
The following record iterations show the value as truncated to the first three figures with a period inserted after the first in all columns.
E.g. I get 4.42 instead of 441,838975.
Anyone have any ideas about this, and why does it work the first time round?
--
www.nabsolutions.se
www.nabsolutions.se
0
Comments
-
hi,
it seems that you have a problem with the NumFormat '0.##' and (internal) language/regional settings when applying the NumFormat to Values. so that means: NumFormat '0.##' converts 441,838975 to 4.42, because the calculation works the american way (. is the seperator sign and , is ignored).
best regardsregards0 -
Yes, you are perfectly right. What threw me off was that it worked for the first row where all the sums where in the thousands.
The man who decided that what is in reality a programming language should be localised ought to drawn and quartered. And possibly shot on sight and someone should definitely dance on his grave to an out of tune accordion. ](*,)
I've had no end of trouble with Excel and localisation in a multinational environment over the years and I should have recognised this.
Someone said that Excel automatically translate all functions when you open the file in a different locale.
Bovine droppings!
The correct numformat should be 0,## for Sweden no matter what the reference says--
www.nabsolutions.se0
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