Skip to main content
Nintex Community Menu Bar
Solved

Extract number before decimal point


Forum|alt.badge.img+10
  • Scholar
  • 61 replies

I am trying to extract the number before a decimal point but keep it as an integer. I have found posts about how to extract numbers, but they all convert them to text. I can’t seem to come up with the needed Regex formula, but I guess there might be another solution?

I would like to convert something like 2023.0 to just 2023.

Best answer by aak1

I just realized that when I upgraded this workflow from O365 to NAC it converted that variable to a decimal. I just created a new integer variable and replaced the old variable. I’m a little slow sometimes :(

 

It is working now.

View original
Translate

6 replies

bamaeric
Forum|alt.badge.img+13
  • Apprentice
  • 463 replies
  • October 31, 2023

Are you trying to do this in a workflow or on a form?

Translate

Forum|alt.badge.img+10
  • Author
  • Scholar
  • 61 replies
  • October 31, 2023

On a workflow in NAC.

Translate

bamaeric
Forum|alt.badge.img+13
  • Apprentice
  • 463 replies
  • October 31, 2023

Try adding and configuring a “Apply a regular expression” action in your workflow with the following settings:

  • Input text = Your number data (form field, variable, etc.)
  • Operation = Extract
  • Pattern = (\d)(?=\.)
  • Ignore case = Yes
  • Store first result in = intDigit  (workflow variable of type Integer)

 

Translate

Forum|alt.badge.img+10
  • Author
  • Scholar
  • 61 replies
  • October 31, 2023

Thanks. It does strip out the “.0” but also only leaves the last number before the decimal point. So 2023.0 just becomes “3”.

Translate

Forum|alt.badge.img+10
  • Author
  • Scholar
  • 61 replies
  • Answer
  • October 31, 2023

I just realized that when I upgraded this workflow from O365 to NAC it converted that variable to a decimal. I just created a new integer variable and replaced the old variable. I’m a little slow sometimes :(

 

It is working now.

Translate

bamaeric
Forum|alt.badge.img+13
  • Apprentice
  • 463 replies
  • October 31, 2023

Sorry, I misread your original post.

Glad it is working now for you.

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings