I have an Ascii file fixed length and it has a value 1000.00
I use a dataport to read it.
I want to enter this value to a decimal variable.
But always it takes 0.
I have made some tests.
I use a code variable and it returned ok.
I use evaluate function
evaluate(mydecimal, mycode);
and it returned 0 again.
How can i enter this value into my decimal variable?
Comments
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
It returns 1000.00 but when i do evaluate i get this error message
Decimal must not be blank.
Decimal is missing or invalid on the expression.
PS you should use message('%1',format(mycode));
the first parameter is a formatting string, so it is possible your value is interpreted.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Decimal must not be blank.
Decimal is missing or invalid on the expression.
May be problem in separator - what this code return? MESSAGE('%1',FORMAT(3/2)[2])
My number is 1000.00 (dot).
How can I convert it?
Just replace (.) dot with (,) comma?
So simple?
I tried it but no I get the same error.
This is my original code
DebitNetAmt and CreditNetAmt returns correct values but when I evaluate them to their decimal variables it crashes.
Have 2 way
1. change region and language options
2. Just change '.' on FORMAT(3/2)[2] symbol
Afer this command, you can convert the "," to ".".
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
and again the returns 1000,00 correctly...
but when evaluate to decimal i get
Decimal must not be blank.
Decimal is missing or invalid on the expression.
Error... ](*,)
I try and this work
str := '10000.01';
str := CONVERTSTR(str,'.',FORMAT(FORMAT(3/2)[2]));
MESSAGE(str);
IF EVALUATE(dec,str) THEN
MESSAGE('%1',dec);
If you have both debit and credit in the dataport, in general one of them is blank, so you need to do this:
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Then just so
if EVALUATE(DebitNetAmtDec,DebitNetAmt) then ;
if EVALUATE(CreditNetAmtDec,CreditNetAmt) then ;