Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: One decimal place in my formula Post Reply Post New Topic
Author Message
gitanjali1027
Newbie
Newbie
Avatar

Joined: 01 Apr 2010
Online Status: Offline
Posts: 25
Quote gitanjali1027 Replybullet Topic: One decimal place in my formula
     Posted: 14 May 2010 at 7:27am
Hello

I have the following in my formula field:

toText(((Sum ({DataTable1.Ending_Value}, {DataTable1.Name})) - (Sum ({DataTable1.Starting_Value}, {DataTable1.Name})) - (Sum ({DataTable1.Investments}, {DataTable1.Name})) + (Sum ({DataTable1.Proceeds}, {DataTable1.Name})) + (Sum ({DataTable1.Interest_and_Dividends}, {DataTable1.Name})))/(Sum ({DataTable1.Starting_Value}, {DataTable1.Name})) * 100)  + " %"

The output is something like:  6.32 %

Instead of having 2 numbers after the decimal, is there any way to only have 1?  I tried the following to no luck:

toText(((Sum ({DataTable1.Ending_Value}, {DataTable1.Name})) - (Sum ({DataTable1.Starting_Value}, {DataTable1.Name})) - (Sum ({DataTable1.Investments}, {DataTable1.Name})) + (Sum ({DataTable1.Proceeds}, {DataTable1.Name})) + (Sum ({DataTable1.Interest_and_Dividends}, {DataTable1.Name})))/((Sum ({DataTable1.Starting_Value}, {DataTable1.Name})) * 100),1)  + " %"

b/c the output kept showing me 0.0 % for everything


Next I tried this:

(toText(((Sum ({DataTable1.Ending_Value}, {DataTable1.Name})) - (Sum ({DataTable1.Starting_Value}, {DataTable1.Name})) - (Sum ({DataTable1.Investments}, {DataTable1.Name})) + (Sum ({DataTable1.Proceeds}, {DataTable1.Name})) + (Sum ({DataTable1.Interest_and_Dividends}, {DataTable1.Name})))/(Sum ({DataTable1.Starting_Value}, {DataTable1.Name})) * 100)  + " %"),1)

No luck with that either.

Anybody have any ideas?
IP IP Logged
Emir_W
Senior Member
Senior Member
Avatar

Joined: 25 Apr 2010
Online Status: Offline
Posts: 228
Quote Emir_W Replybullet Posted: 16 May 2010 at 9:48pm
try this:
 
totext((yourformula)*100 ,1,'' ) + " %")
 
 
 
hope it help


Edited by Emir_W - 17 May 2010 at 1:11am
Emir W
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