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:
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;
``
Which Country/Region NAV you are using (W1/ NA/ IN/ GB), based on that change thousand separator in your regional settings so that you will not get that special character when exporting to external file.
If you insist on doing it this rather strange way, then ok with me.
But why don’t you just use FORMAT(TotalAmount,0,1)?
The way the amount is exported without any spaces or thousand-dots etc. The format used is global:
In fact if the XML file you’re creating is for integrating with other systems, then you can also use FORMAT(TotalAmount,0,9) - format number 9 is the standard XML file decimal format.