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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fill Spaces w/ Asterisk

Status
Not open for further replies.

csjoseph

MIS
Jan 2, 2001
247
US
I'm creating a report for printing checks. In the amount field they want it always to be 12 spaces. If the amount is not twelve characters they want me to fill the leading spaces w/ asterisks. Does anyone know a quick way to do this?


Thanks.

Chris
IS Manager
 
Write a formula to do this:

replicatestring("*",12-len(totext({YourField},2,"")))&totext({YourField},2,"")

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
Try this

Code:
stringvar x := totext({table.number});

if length(x) > 11 then x
else
  replicatestring("*",12 - length(x)) + x

Cheers,
-LW
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top