Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Formatting in crystal reports Post Reply Post New Topic
Author Message
PradeepVpm
Newbie
Newbie
Avatar

Joined: 01 May 2012
Location: India
Online Status: Offline
Posts: 1
Quote PradeepVpm Replybullet Topic: Formatting in crystal reports
     Posted: 01 May 2012 at 8:41pm
is it possible to customize decimal digit or round off for some particular fields in crystal report ?? using formula please reply me if anyone knows....
Pradeep
IP IP Logged
Gurbs
Senior Member
Senior Member
Avatar

Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
Quote Gurbs Replybullet Posted: 02 May 2012 at 3:05am
Does it needs to stay a numeric field? Otherwise you could trie something like

totext(abs({table.field}),0)

The results would be like

33.72    -->    34
35.25    -->    35

Edited by Gurbs - 02 May 2012 at 3:06am
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 02 May 2012 at 3:29am
you could also do something like:
local numbervar x := {table.field} * 1000 //for instance
 
//apply your rounding rules, maybe x := cint(x)
 
x := x/1000;   //divide it back to get the correct number of decimal places
 
x
 
there is also the formatting that can be customized to do the rounding, but if you want truncation of the number at a number of digits, this is one way.
IP IP Logged
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