Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: CEILING to 0.05 in CR 10 Post Reply Post New Topic
Author Message
MAwadi
Newbie
Newbie


Joined: 16 Mar 2011
Location: Egypt
Online Status: Offline
Posts: 3
Quote MAwadi Replybullet Topic: CEILING to 0.05 in CR 10
    Posted: 16 Mar 2011 at 9:50pm
Hi Every One
 
I Use a Crystal Report 10 Version 10.0.0.533. There is not a function CEILING as in Ms Excell. I have a Calculating field.
 
So how can i make ceiling to 0.05?
 
Ex:
7.33 will become 7.35
7.5   will become 7.5
7.88 will become 7.9
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 17 Mar 2011 at 3:24am
my thought would be to code a function for the report.  since you know the number of decimal places desired, you could write a function like:
pass in the number(x), pass in the ceiling value (y)
 
local numbervar temp := x/y;
if temp - int(temp) <> 0 then
  temp := int(temp) + 1;
temp * y
 
HTH
IP IP Logged
MAwadi
Newbie
Newbie


Joined: 16 Mar 2011
Location: Egypt
Online Status: Offline
Posts: 3
Quote MAwadi Replybullet Posted: 19 Mar 2011 at 5:38am
Thank u for ur reply
but i try many ways and many function. but i didin't get what i need.
IP IP Logged
MAwadi
Newbie
Newbie


Joined: 16 Mar 2011
Location: Egypt
Online Status: Offline
Posts: 3
Quote MAwadi Replybullet Posted: 20 Mar 2011 at 1:22am

Finally I find the way. This is the idea  Ex: 7.33

A = 7.33
B = Round(7.33,1) The Result is 7.30
C= A-b The Result is 7.33-7.3 = .03
 
If C = 0.05 or -0.05 then 0
elseIf (0.05-C) < 0.05 and C > 0 then 0.05-C
elseIf 0.05 - C > 0.05 Then C-0.05
 
Thank Every Body
 
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.