Print Page | Close Window

Showing leading zeroes

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=15567
Printed Date: 19 Apr 2025 at 9:32pm


Topic: Showing leading zeroes
Posted By: HelenH
Subject: Showing leading zeroes
Date Posted: 07 Feb 2012 at 9:54pm
Embarrassed
Silly question I'm sure
I have a number field that I want to display in my report as a 4 digit number with the elading zeroes, e.g. "0001", "0234", etc
Can't figure out how to do it
Can any one help?



Replies:
Posted By: lockwelle
Date Posted: 08 Feb 2012 at 3:28am
you could display it as a string and use a formula like:
 
right("0000" + totext({table.field}, 0,""), 4)
 
HTH



Print Page | Close Window