Print Page | Close Window

Suppressing Zero Decimals

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=3361
Printed Date: 05 May 2024 at 2:44pm


Topic: Suppressing Zero Decimals
Posted By: emalbritton
Subject: Suppressing Zero Decimals
Date Posted: 06 Jun 2008 at 7:44am
I was wondering if there is any way to conditionally suppress decimal formatting on a number field if the decimals are zeros.
 
example...quantity of 7
 
with the decimal formatting set to 2, the displayed number would be 7.00 and I want to just see 7, however, if the quantity is 7.5 that is what I would like to see as well as 7.25.
 
Thanks in advance for any ideas.
 
Emily



Replies:
Posted By: bhaski
Date Posted: 10 Jun 2008 at 3:45am
sure

go thru like this

right click yr numeric field>format editor>number button>below Customize>decimals field>click formula editor

then write this

if (your_numeric_field mod Truncate (your_numeric_field))>0 then 2
else 0

then run

n'joy




Print Page | Close Window