toInteger() parameters

Hello!

I'm very surprised when I put toInteger("ab7cde?z2n7k") and got 727 as a result. From my point of view it is not an integer at all.

  Discussion posts and replies are publicly visible

Parents
  • When converting a string to integer in Appian, tointeger() strips all the non numeric characters from the string and them returns only the numeric characters and casts it into a numeric data type.

    for Example: if you have an array of String {"sdfv1254s5dfv", "15dfv125svd"}
    using an tointeger() on this will return an array of integers

    Expression: tointeger({"sdfv1254s5dfv", "15dfv125svd"})
    Output:
    Type: List of Number (Integer)
    Output: {12545,15125}

    and if you want to verify if a type of input then you can use typename(typeof("ab7cde?z2n7k")) this will return text
Reply
  • When converting a string to integer in Appian, tointeger() strips all the non numeric characters from the string and them returns only the numeric characters and casts it into a numeric data type.

    for Example: if you have an array of String {"sdfv1254s5dfv", "15dfv125svd"}
    using an tointeger() on this will return an array of integers

    Expression: tointeger({"sdfv1254s5dfv", "15dfv125svd"})
    Output:
    Type: List of Number (Integer)
    Output: {12545,15125}

    and if you want to verify if a type of input then you can use typename(typeof("ab7cde?z2n7k")) this will return text
Children