Skip to main content
December 1, 2022
Question

Check if given number is between 1 & 20 digits

  • December 1, 2022
  • 2 replies
  • 0 views

Please help me check if the given number is between 1 & 20 digits and doesn't contain any alphabet in it.

Like we have like(fv!item,"[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]") to check the given number should be exactly 10 digits and no alphabets in it.

    2 replies

    harshitb6843
    December 1, 2022

    and(
      a!isNotNullOrEmpty(ri!number),
      len(ri!number) < 20,
      a!isNullOrEmpty(stripwith(ri!number,"0123456789"))
    )

    The first condition checks that it should not be less than 1 digit. 
    Second condition checks that it should not be more than 20 digits. 
    Third condition checks that it should only contain numbers. 

    karthikr067273
    December 1, 2022

    Hi Shamima
    Maybe the following piece of code will work for you.

    and(a!isNotNullOrEmpty(fv!item), len(fv!item) <= 20, all(fn!like, char(code(fv!item)), "[0-9]"))