Hello All
I am outputting data from Navision to a CSV file.
However, there is another product involved later down the chain and they want me to remove "" and all , from numbers. For example, I currently output 1,323.34 They want it 1323.34
I am using the following to write to my csv file etc.
LostOutstream.WRITETEXT(STRSUBSTNO('"%1",', LrecSalesInvoice.Amount));
I have tried using FORMAT but to no success.
Ideas?
How do we remove the , from these numbers?
Thanks
0
Comments
LostOutstream.WRITETEXT(DELCHR(FORMAT(STRSUBSTNO('"%1",', LrecSalesInvoice.Amount))),'=',',');
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Dec1 := 12345678;
Dec2 := 122.34;
Dec3 := 1222;
Message('D1:%1, D2:%2, D3:%3',DELCHR(FORMAT(Dec1),'=',','),
DELCHR(FORMAT(Dec2),'=',','),
DELCHR(FORMAT(Dec3),'=',','));
You can use the FORMAT Command with Standard format 1 or 2.
The help implies that Decimal Standard format 2 is equivalent to using the string '<Sign><Integer><Decimals><1000Character,.>' as the third argument to the FORMAT function.
I believe, however, that the <1000Character,x> attribute is used to specify the character to be used to separate the thousands groups, and is only useful in a format string that has specified <Integer Thousand>. As I understand it, <Integer Thousand> means: "Break the integer portion up into groups of three, and separate the groups with the <1000Character,x> attribute (if specified), otherwise use the 'Digit Grouping Symbol' specified in the for the Locale selected in the Control Panel." Furthermore, on experimentation, the <1000Character,x> attribute seems to be ignored even if specified for Decimal formats.
For those who wish to try for themselves, here's a hint:
The correct 'fully specified equivalent' for Decimal Standard Format 2 is '<Sign><Integer><Decimal><Comma,.>' where the <Comma,x> attribute specifies the character to use to separate the Integer and Decimal portions of the result.
The difference between Standard Format 1 and Standard Format 2 is that Standard Format 2 is guaranteed to use a period for the decimal point, whereas Standard Format 1 will use whatever 'Decimal Symbol' is specified by the current user in the Control Panel.