Print Page | Close Window

Rounding numbers - prevention

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=9338
Printed Date: 19 Apr 2024 at 11:58pm


Topic: Rounding numbers - prevention
Posted By: Snowharp
Subject: Rounding numbers - prevention
Date Posted: 09 Mar 2010 at 1:23pm
I am producing reports connected with payroll.  The reports are used for budgetting purposes and we do not want Crystal Reports to indulge in any rounding at all.  Even one cent off seems to upset the Finance people.
 
I have searched the net for solutions but so far there appears to be no easy way to tell Crystal to leave the numbers as they are.  I would like to display the results with two decimal places and if that means truncating a third decimal number then so be it.
 
Settings in the customized rounding dialog seem to be without a simple setting that says "no rounding". 
 
The numbers start with three decimal places but the report requires that we display only two.  Advice would be most welcome.



Replies:
Posted By: razzak
Date Posted: 09 Mar 2010 at 8:51pm
select the field to which you want to show two decimal places.right click on the field go to format field-->go to number tab -->click on customize-->then in Decimal select "1.00".
 
please let me know if any problem.
 


-------------
Razzak Sayyed


Posted By: Snowharp
Date Posted: 10 Mar 2010 at 5:14am
Thanks for your response but this does not deal with the issue of rounding.  For example; a column of about 8 subtotals is added up and the result is 1,204.258.  We want the displayed result to be 1,204.25 but Crystal Reports keeps posting 1,204.26 which, according to the finance people is one cent off. 
 
If you add that column of figures with a calculator you get 1,204.25 and that is what they want to see.
 
I simply want to find a way to force the display to clip the third decimal off without causing it to round up the 100th decimal place.  There are so many settings we can use but none seems to address this at all. 


Posted By: kevlray
Date Posted: 10 Mar 2010 at 8:19am

There is a truncate function.  That should elimate the rounding issue.

 
I hope this helps.
 


Posted By: razzak
Date Posted: 11 Mar 2010 at 5:33am
yes truncate will help you .
use truncate({table1.amt},2)


-------------
Razzak Sayyed


Posted By: Snowharp
Date Posted: 11 Mar 2010 at 5:35am
Yes, thanks for this advice.  I have tried Truncate() and it seems to work pretty well.  Excellent !
 
 



Print Page | Close Window