Long integer configuration

Hello,

So I am trying to create a configuration node that can take integers bigger than the range -2,147,483,647 - 2,147,483,647.
I see I can do it only with double configuration nodes? Is that true?

Hi @vasichar11

The data type long will be able to hold integers outside of this range.
When I played around neither the Double Configuration node nor the Integer Configuration node would take numbers outside of that range. My proposed workaround/solution would be to go with the String Configuration node, and then convert the user-given number to a Long.
Some ways to do so are

  • String Manipulation (Variable) node + toLong() function
  • Variable to Table Row + String Manipulation
  • Variable Expression node

whatever would suit your purposes best.
Hope that helps :slight_smile:

Best,
Alice

2 Likes

Hi @vasichar11 , in addition to the suggested workaround from @Alice_Krebs, you can add some validation to the String Configuration node too.

If you specify that it requires a regex pattern that allows only digits, you can ensure that the user may supply only numeric integer values.

eg. integers with at least one digit…
[0-9]+

or, enforce that they enter between 1 and, say, 10 digits
[0-9]{1,10}

1 Like