Regular Expression to Get the First Digit Before a Decimal Point in a Nintex Automation Cloud (NAC) Workflow

Using the “Apply a Regular Expression” action in Nintex Automation Cloud (NAC) workflow, you can get the first digit (ones digit) before a decimal point.

Here are the steps to follow:

  1. Insert an “Apply a Regular Expression” action into your workflow.
  2. Configure it with the following settings:
    1. Input text = Number from a workflow variable (can be currency or decimal type)
    2. Operation = Extract
    3. Pattern = (\d)(?=\.)
    4. Ignore = Yes or No (does not matter)
    5. Store first result in = Workflow variable (can be an integer or text type)
  3. You can then use the workflow variable as you need it in your workflow.

Here are example results from using this Regular Expression in a workflow:

StringRegular ExpresssionResult
6.5(\d)(?=\.)6
1234.56(\d)(?=\.)4
1234567.8901(\d)(?=\.)7
Nintex Automation Cloud - Regular Expression RegEx - Get Ones Digit

Leave a comment

Website Powered by WordPress.com.

Up ↑