How to find the middle number from the group of number such as 123456789. pls give the code

pls reply

  • Step 1 - First get the STRLEN of the string and then once you get the STRLEN you divide it by 2,
    if your string length is odd then you have to use the ROUND function
    Step 2 - Use COPYSTR function from the result of STRLEN posting divided by 2,1 and you get the middle no.

    Example - a := '123456', B := STRLEN(A) will return 6, the result divided by 2 will give you 3. COPYSTR(B,3,1) will give you 3 which is the middle of number of string a.
  • (STRLEN(NumberGroup)/2)+(STRLEN(NumberGroup) MOD 2)
Related