Print Page | Close Window

decimal number format

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2022
Forum Name: Tips and Tricks
Forum Discription: Have you learned some great tricks to share with the group? Post them here!
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=19573
Printed Date: 03 May 2025 at 4:22am


Topic: decimal number format
Posted By: taniarto
Subject: decimal number format
Date 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




Replies:
Posted By: kevlray
Date 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. 


Posted By: taniarto
Date 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


Posted By: kevlray
Date Posted: 28 May 2013 at 5:33am
?!? I have never seen it do that ?!? I cannot explain it.


Posted By: DBlank
Date Posted: 06 Jun 2013 at 3:51am
floor(table.field,1)


Posted By: kevlray
Date Posted: 06 Jun 2013 at 8:39am
I always forget about floor (don't need it very often).



Print Page | Close Window