Function fixlength(what$, length as integer) as String
Dim x as integer,diff as integer x = len(what$) If x = < length Then diff= length - diff While x < length what$ = "0" & what$ x = len(what$) Wend fixlength = what$ Else fixlength = what$ End If End Function Inputs:the number {string} to be formated and the lenght of the result string Returns:formated string. if the length specified is shorter that the string passed, the original string is returned Assumes:although this code formats digits, these digits are passed and returned as strings |