INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Remember Me

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Just copy and paste the

# zero with field format D12.1

Share

## zero with field format D12.1

(OP)
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

### RE: zero with field format D12.1

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

### RE: zero with field format D12.1

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

### RE: zero with field format D12.1

(OP)
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

### RE: zero with field format D12.1

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.

### RE: zero with field format D12.1

Hi Eva are you asking abt Decode , think you can easily do a decode for that .

### RE: zero with field format D12.1

(OP)
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

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Close Box

# Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!