Problem with DELCHR

poppins
Member Posts: 647
Hi everyone,
I am using an xmlport to export decimal fields into a text file.
For the decimals in thousands, for exmple 1 758.245, the generated text file shows 1ÿ758.245
I tried to remove the blank space by writing the following code:

What shall I do???
I am using an xmlport to export decimal fields into a text file.
For the decimals in thousands, for exmple 1 758.245, the generated text file shows 1ÿ758.245

I tried to remove the blank space by writing the following code:
amount:=FORMAT(totalAmount); FOR K := 1 TO strlen(amount) DO BEGIN IF ((amount[K] <> '0') AND (amount[K] <> '1') AND (amount[K] <> '2') AND (amount[K] <> '3') AND (amount[K] <> '4') AND (amount[K] <> '5') AND (amount[K] <> '6') AND (amount[K] <> '7') AND (amount[K] <> '8') AND (amount[K] <> '9') ) THEN BEGIN NotNum := amount[K]; amount:= DELCHR(amount,'=',NotNum); END; END;but it didn't work


What shall I do???
0
Answers
-
Try FORMAT(TextAmount,0,1)0
-
I found the following code in mibuso:
txtCharsToKeep := '0123456789'; txtString := DELCHR(txtString,'=',DELCHR(txtString,'=',txtCharsToKeep));
but I didn't know how to declare txtString in C/AL Globals...is it a string or what?0 -
Strange, the FORMAT should work.
However you can use the code you have found, both txtCharsToKeep and txtString are both string variable. Also you need to add '.' at the end of the txtCharsToKeep otherwise it will strip out your decimal point.0 -
Kishorm wrote:Strange, the FORMAT should work.
However you can use the code you have found, both txtCharsToKeep and txtString are both string variable. Also you need to add '.' at the end of the txtCharsToKeep otherwise it will strip out your decimal point.
Anyway, I declared the txtCharsToKeep as string and it worked...
Thanks a lot Kishorm0
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