Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

zero with field format D12.1

Status
Not open for further replies.

kaeserea

Programmer
Feb 26, 2003
164
DE
Hello!

I compute a field in my report where I use an if statement to say: use the given formular if any of the formular elements are not equal to zero. If not print zero.

What happens is that in the "print zero" case I receive a ,0 in my report instead of a simple 0. This might be due to the fact that the format of the computed field is D12.1. How can I achiev a simple 0?

Eva
 
Hey did you try using edit on that zero or may be do a decode and if its ,0 then display a field which is integer 0.

exampple


decode (formular,<> 0 ,0,= 0,formular)

see if this thing works , may be i would have understood ur ? wrong.
Thank you.

Ganesh
 
You can also define the field with the 'S' edit option, for zero suppress (D12.2S).
 
Hello Ganesh,

Can you tell me something about your code line? I have never seen that before.

Hi focwizard,

I'd like to display the zero. The S option prints nothing if the value is zero.

Eva
 
The field type determines the output display, so a D12.1 will show .0 by default. Try using a D12, a P12 or an integer field (I5 etc). These all show a single zero but some may not be suitable for calculations involving decimal places, as P format will round up and I format will truncate.
 
Hi Peter,

the problem is that I need the D12.1 format for all fields which are not equal to zero.

Hi Ganesh,

can you explain me with an example how you mean the DECODE in your first answer?

Thanx!
Eva
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top