Tips and Tricks
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Tips and Tricks
Message Icon Topic: decimal number format Post Reply Post New Topic
Author Message
taniarto
Groupie
Groupie
Avatar

Joined: 15 Oct 2010
Online Status: Offline
Posts: 52
Quote taniarto Replybullet Topic: decimal number format
    Posted: 23 May 2013 at 9:58pm
Dear All,

I have some number :

97,698,064.5
25,517,951.7
36,175,099.0

I want to make it :

97,698,064
25,517,951
36,175,099

I don't want to use the last decimal number. I try to make it by changing the format but it run rounding I only need the number without the decimal value. I also try truncate function but itu still the same.

Please help..

thanks

IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 24 May 2013 at 6:31am
The truncate function should work.  Be sure to put in the second argument to the function i.e, truncate({Some Field},0).  Help says it truncates everything to the right of the decimal, but I like to explicitly put a value in. 
IP IP Logged
taniarto
Groupie
Groupie
Avatar

Joined: 15 Oct 2010
Online Status: Offline
Posts: 52
Quote taniarto Replybullet Posted: 26 May 2013 at 7:07pm
I have try use the truncate
but it result on the
36,175,099.0 it became 36,175,098 (it is rounding)

thanks
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 28 May 2013 at 5:33am
?!? I have never seen it do that ?!? I cannot explain it.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 06 Jun 2013 at 3:51am
floor(table.field,1)
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 06 Jun 2013 at 8:39am
I always forget about floor (don't need it very often).
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.016 seconds.