Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Format a number with leading zeroes 1

Status
Not open for further replies.

sschaller

Programmer
May 10, 2007
10
One of my Peachtree customers needs to export check data to an ASCII file so that they can upload it to their bank. I figured I could create this in Crystal. Each field needs to be a specific number of characters and some need to have leading zeroes to fill up the space. I figured out how to create a formula to add zeroes in front of the check number, which is a text field but I'm having trouble with the dollar amount of the check, which is formatted as a number. There can be no commas or decimal points. $100.50 needs to be exported as 000000010050. I can keep it as a number and format it as 10050 without any problem but I can't get the zeroes in front. If I change it to text I can add the zeroes but it puts the commas and decimal points in: 000000010,050.00

Any ideas?
 
sschaller,

try:

picture(totext(({table.number}*100),0,""),"000000000000")

Andy
 
Another variation:

totext({table.field} * 100,"000000000000")

~Brian
 
dbreed35,

Your variation actually works, mine put too many leading zeros.

Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top