IF (TableID = 271) AND (BankMapRec."Field No." = 17) THEN
IF EVALUATE(testDecimal,FORMAT(RecField)) THEN BEGIN
RecField.VALUE(FORMAT(ABS(testDecimal),0,9));
But this is not going correctly. Still appear thosusand thousand separator. what should I do?
Answers
https://resrequest.helpspot.com/index.php?pg=kb.page&id=279
But be aware that for 11375,75 this code returns 1137575 as a result.
For 11 375,75 a conversion error will occur.
I would use the Format function with XML settings (last parameter is 9).
String := FORMAT(Value [, Length] [, FormatStr/FormatNumber])
// Sample
T17_Temp.INIT;
T17_Temp.Amount := 11375.75;
RecRef.GETTABLE(T17_Temp);
FldRef := RecRef.FIELD(17);
testDecimal := FldRef.VALUE;
// by default is formatted with <Integer Thousand> i.e. Format 0
MESSAGE(FORMAT(testDecimal));
// comma or any other thousand separator is removed - Format 9
MESSAGE(FORMAT(testDecimal,0,9));
More elaborated formatting could be achieved by composing the relevant FormatStr
IF (TableID = 271) AND (BankMapRec."Field No." = 17) THEN
IF EVALUATE(testDecimal,FORMAT(RecField)) THEN BEGIN
RecField.VALUE(FORMAT(ABS(testDecimal),0,9));
But this is not going correctly. Still appear thosusand thousand separator. what should I do?
Still appearing for thousand separator this too.