Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: padding field with decimal places Post Reply Post New Topic
Author Message
andyp
Newbie
Newbie
Avatar

Joined: 20 Sep 2010
Location: Germany
Online Status: Offline
Posts: 19
Quote andyp Replybullet Topic: padding field with decimal places
     Posted: 20 May 2013 at 10:49am
Hi

I need to pad a field with leading zero's so that it always has a length of 10 (including decimal point)

Example 150.00 needs to be 0000150.00
2500.50 needs to be 0002500.50
00.00 needs to be 0000000.00

Any ideas?

Edited by andyp - 20 May 2013 at 10:52am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 20 May 2013 at 10:58am
what is the field type currently?
IP IP Logged
andyp
Newbie
Newbie
Avatar

Joined: 20 Sep 2010
Location: Germany
Online Status: Offline
Posts: 19
Quote andyp Replybullet Posted: 20 May 2013 at 11:01am
Its a number field
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 20 May 2013 at 11:06am
totext({table.field},'0000000.00',2)
IP IP Logged
andyp
Newbie
Newbie
Avatar

Joined: 20 Sep 2010
Location: Germany
Online Status: Offline
Posts: 19
Quote andyp Replybullet Posted: 20 May 2013 at 11:09am
Thanks for your prompt assistance, will try it first thing in the morning
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