padding a string with xter 0

isijay
02-18-2001, 03:31 AM
can someone help me with a function to pad an expression with xter 0? for instance a field must be 10 xters if it is less then pad with 0 to make up the required length

Derek Stone
02-18-2001, 07:59 AM
Do you want the extra zeros on the right or left of the text?

Right:
r = String$(10 - Len(r), "0") & r

Left:
r = r & String$(10 - Len(r), "0")

Good Luck
-cl

<a href="http://vb.wsoftware.net" target="_new">http://vb.wsoftware.net</a>

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum