Skip to main content
hema.mathivathanan
Employee
Sep 1, 2023 2:25 PM UTC
Solved

Add Zeros in the string

Hi, 

I want my alphanumeric field with the below condition.

if the text is asdf45 I want the output total as 10 digits with Zero's in the front. How can I do that?

When I try doing text(asd45,"0000000000") --> this is not considering the strings present.

Thanks!

    hema.mathivathanan
    Employee
    Sep 1, 2023 2:44 PM UTC

    I used join array and repeat function and it worked

    4 replies

    hema.mathivathanan
    hema.mathivathananAuthorAnswer
    Employee
    Sep 1, 2023 2:44 PM UTC

    I used join array and repeat function and it worked

    mathieud0001
    Genius
    Sep 1, 2023 3:07 PM UTC

    Probably cleaner to do something with a combination of concat/stripWith/cleanWith/text.

    mathieud0001
    Genius
    Sep 2, 2023 12:31 PM UTC

    a!localVariables(
      local!text: "asdf45",
      concat(
        stripwith(local!text, "0123456789"),
        text(
          cleanwith(local!text, "0123456789"),
          "0000000000"
        )
      )
    )

    New Participant
    Jan 30, 2026 9:42 AM UTC

    rept("0", 10-len("asdf45")) & "asdf45"