Skip to main content
August 4, 2022
Question

want to understand the logic for below output

  • August 4, 2022
  • 4 replies
  • 0 views

there is 16 digit card no which in text format like { 2567893025367892} want the output as {2567-8930-2536-7892}.

    4 replies

    csteward
    August 4, 2022

    Try:

    a!localVariables(
      local!cardNo: "2567893025367892",
      
      joinarray(
        a!forEach(
          items: 1+(enumerate(4)*4),
          expression: mid(local!cardNo,fv!item,4)
        ),
        "-"
      )
    )

    August 4, 2022

    thnks alot

    csteward
    August 4, 2022

    No problem!  Feel free to mark this as answered if that solves your use case.

    August 5, 2022

    by using text function we can achieve it. for example: text("2567893025367892","####-####-####-####")