I need code for reversing a number with out using the appian functions

Certified Associate Developer

a!localVariables(
local!num: 12345,
local!reversed: 0,

{
a!forEach(
items: local!num,
expression:
a!localVariables(
local!reversed{local!num: quotient(local!num, 10),
local!reversed: ((local!reversed * 10) + local!num),
local!num: mod(local!num,10)},
)
)
}
)

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Which of the Appian functions do you want to avoid?

    What is your shared code meant to do?

    An example which does not use the reverse() function:

    a!localVariables(
      local!value: 12345678,
      local!digits: tointeger(char(code(local!value))),
      tointeger(
        concat(
          index(
            local!digits,
            count(local!digits) - enumerate(count(local!digits))
          )
        )
      )
    )

Reply
  • 0
    Certified Lead Developer

    Which of the Appian functions do you want to avoid?

    What is your shared code meant to do?

    An example which does not use the reverse() function:

    a!localVariables(
      local!value: 12345678,
      local!digits: tointeger(char(code(local!value))),
      tointeger(
        concat(
          index(
            local!digits,
            count(local!digits) - enumerate(count(local!digits))
          )
        )
      )
    )

Children