Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: convertion Post Reply Post New Topic
Author Message
LHMi
Newbie
Newbie


Joined: 06 Nov 2008
Online Status: Offline
Posts: 1
Quote LHMi Replybullet Topic: convertion
     Posted: 06 Nov 2008 at 4:12am
Hello All,

We have crystal reports version 8.

I have a field with numbers and when I choose "browse data" I can see that the data is in a string format with length 32.

For example I get: 1.0e-005   1.5e-001    1.5e-004  etc...

Now I would like to display the value like this: 1.0e-5   1.5e-1  1.5e-4  without the 2 zeroes.

Anyone an idea on how to do this?

Thanks in advance,
Bart Geeraerts
Labo Manager LHM Instrumentation
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 06 Nov 2008 at 5:42am

Hi

Create a formula in Crystal and use the code below

left("1.0e-005",4)+replace(Mid("1.0e-005",instr("1.0e-005","-")),"00","")

 
Replace the hard coded values with {table.fieldName}
 
Cheers
Rahul
IP IP Logged
twinkle
Newbie
Newbie
Avatar

Joined: 16 Jun 2008
Location: United Kingdom
Online Status: Offline
Posts: 32
Quote twinkle Replybullet Posted: 06 Nov 2008 at 8:27am
Good ans rahuls but your formula will limit the variance e.g if 1.54e- occurs etc
try this instead
 
=LEFT(I2,instr("e",I2)+1)&ROUND(MID(I2,instr("e",I2)+2,100),0)
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 07 Nov 2008 at 12:17am
Hi
 
Thanks Twinkle, I was trying your formula can you let me know what is I2
 
Cheers
Rahul
IP IP Logged
twinkle
Newbie
Newbie
Avatar

Joined: 16 Jun 2008
Location: United Kingdom
Online Status: Offline
Posts: 32
Quote twinkle Replybullet Posted: 07 Nov 2008 at 9:22am
sorry my mistake - change I2 to the field name!!
 
cheers
 


Edited by twinkle - 07 Nov 2008 at 9:23am
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