mvanta
3rd July 2014, 08:55
Hello all and good morning!
I am using a ZZZZZZZZ9V,99 field on a report but when the number to display has less digits spaces are inserted. Can those spaces be removed?
Thank you in advance,
Maria
bhushanchanda
3rd July 2014, 10:27
Hi,
You can try trim$(str$(field_name)).
mvanta
3rd July 2014, 14:08
Hello!Thanks for your answer!!
Since my field is a numeric one I am using: abs(Field_name).
The field is of tfgld.amnt domain (double).
Can I combine trim$ as well?
Maria
bhushanchanda
3rd July 2014, 14:30
Hi,
str$() will convert your value to string and trim$() will remove the spaces.
trim$(str$(abs(field_name)))
mvanta
3rd July 2014, 17:04
Hi!
I did what you suggested but i am getting an error.
Argument 1 for function 'round' has illegal type.
Illegal type combination:string should be double.
Maria
bdittmar
3rd July 2014, 20:56
Hi!
I did what you suggested but i am getting an error.
Argument 1 for function 'round' has illegal type.
Illegal type combination:string should be double.
Maria
Hello,
post your statement, please.
Where do you use the round ?
round()
Syntax:
function double round (double value, long diga, long mode)
Description
This rounds a given value to a specified number of decimal places.
Arguments
double value The value to be rounded.
long diga The number of decimal places to which value is to be rounded.
long mode 0 truncate (for example, both 1.5 and 1.49 are rounded down to 1)
1 normal round (for example, 1.5 is rounded up to 2; 1.49 is rounded
down to 1)
2 round up (for example, both 1.5 and 1.49 are rounded up to 2)
Return values
The rounded value. Or the original value ( value ) if an error occurs.
Because the return value is of type double, the number of digits after the decimal sign is always 6. For example, round(1.345, 2, 1) returns 1.350000.
Regards
mvanta
4th July 2014, 08:16
I have a report attached on a session and on the report I have a field that will display an amount of the following print format:ZZZZZZZZ9V,99.
The print expression of the field is:abs(tfgld930.damt) of domain tfgld.amnt.
(The domain is of type double and due to this I think was my mistake!)
My problem is that the amounts are not of fixed length so when of smaller length spaces are displayed and I want to make them disappear!!
I tried what bhushanchanda suggested on my print expression but without success.
Any ideas?
Maria
bdittmar
4th July 2014, 14:58
I have a report attached on a session and on the report I have a field that will display an amount of the following print format:ZZZZZZZZ9V,99.
The print expression of the field is:abs(tfgld930.damt) of domain tfgld.amnt.
(The domain is of type double and due to this I think was my mistake!)
My problem is that the amounts are not of fixed length so when of smaller length spaces are displayed and I want to make them disappear!!
I tried what bhushanchanda suggested on my print expression but without success.
Any ideas?
Maria
Hello,
you can't use it as print Expression.
Define a stringvariable in ReportScript like >> string amountstring(12) <<
and use :
amountstring = trim$(str$(abs(field_name)))
Or ... use trailing ZERO for the double value.
Or something with sprintf$ like :
amountstring = sprintf$("%-.10A001", field_name)
Regards