Skip to main content
Participant
May 14, 2012
Question

padding zeros at first of number

  • May 14, 2012
  • 1 reply
  • 815 views

I have numbers ranging from 4 -10 digits. I need them all to be a uniform 15 digits.  I am trying to pad leading zero's on the front. I am new to writing scrip and need to know what code to use and where to put it.

    This topic has been closed for replies.

    1 reply

    Legend
    May 14, 2012

    Either #numberFormat(myNumber,"000000000000000")# or #right("000000000000000"&myNumber,15)#.

    I would probably use the second because a 15 digit number may overflow a numeric variable content. You'll have to make some adjustments to the second method if "myNumber" contains negative numbers.