locked
I'm trying to get Infopath to assign a change number with leading zeros RRS feed

  • Question

  • The place I am working for wants files with a 3 digit number. So I create a dummy form called 001. However my formula with is changenum=changenum+1 returns 2 and not 002. Is there any way to make it keep the leading zeros?
    Tuesday, July 12, 2011 9:22 PM

Answers

  • Thanks guys, I figured it out. I pass the number to another field which is text and use if number is less than 10 add "00"

    and if number is more than 10 and less than 100 add "0"

    Thanks for the help.

    • Proposed as answer by Mohamed Derhalli Friday, July 22, 2011 5:43 PM
    • Marked as answer by Lily Wu Saturday, July 23, 2011 3:38 PM
    Friday, July 22, 2011 4:48 PM

All replies

  • You need to use formula like that: concat(substring("00", 1, 3 - string-length(../my:поле1)), ../my:поле1) поле1 is the number you want to represent
    Wednesday, July 13, 2011 6:47 AM
  • Thanks, but will that formula always add the zeros. e.g. if the resulting number is 10 will it come out 0010? That's not really what I need.
    Wednesday, July 13, 2011 1:48 PM
  • Can you save the number as simply the number value, and then reformat it to display 3 digits only at the point where you need to display it?
    Wednesday, July 13, 2011 2:58 PM
  • Thanks guys, I figured it out. I pass the number to another field which is text and use if number is less than 10 add "00"

    and if number is more than 10 and less than 100 add "0"

    Thanks for the help.

    • Proposed as answer by Mohamed Derhalli Friday, July 22, 2011 5:43 PM
    • Marked as answer by Lily Wu Saturday, July 23, 2011 3:38 PM
    Friday, July 22, 2011 4:48 PM
  • If that way helped you, mark it as answer so other people benefit from it when they search about it.
    Mohamed Derhalli ||| SharePoint Specialist ||| http://Path2SharePoint.com
    Friday, July 22, 2011 5:43 PM
  • I have 10 digit number but my client is asking searching leading zeros in sharepoint

    How can i search leading zeros 

    but my server is no one zeros before 10 digit number 

    Wednesday, November 14, 2018 5:10 AM