mai-kel
Process Pupil

Rounding numbers 2 places after decimal within workflow

Simple question, how can I round integer numbers to 2 places after the decimal within a workflow?

 

Cheers

mai-kel

0 Kudos
Reply
8 Replies
mai-kel
Process Pupil

Re: Rounding numbers 2 places after decimal within workflow

Regular expression anyone?! 🙂
0 Kudos
Reply
kunalpatel
Automation Master
Automation Master

Re: Rounding numbers 2 places after decimal within workflow

@mai-kel .....Below is the RegEx:

 

^\d+(\.\d{1,2})?$

 

BTW, is there a reason you can't do this on a list column?

0 Kudos
Reply
mai-kel
Process Pupil

Re: Rounding numbers 2 places after decimal within workflow

@kunalpatel : thanks for your reply, unfortunately it does not work here - what did I do wrong?!

1.PNG

 

Column is saving minutes (which is ok), but I need time in hours. But I do not want to add another column... table is already quite huge. : /

0 Kudos
Reply
kunalpatel
Automation Master
Automation Master

Re: Rounding numbers 2 places after decimal within workflow

@mai-kel .....Can you tell me how you're getting that value? Is it some calculation in the workflow or is it coming from a form/list?

0 Kudos
Reply
SimonMuntz
Nintex Employee
Nintex Employee

Re: Rounding numbers 2 places after decimal within workflow

Hi,

Use a regular expression with an extract operation and this pattern:

\d\.\d{2}

Seems to work.

2DP.png

 

0 Kudos
Reply
mai-kel
Process Pupil

Re: Rounding numbers 2 places after decimal within workflow

Hi Simon,

This also trims left from the separator, I tried 11.234567 and received also 1.23 back.... 😞

Cheers
mai-kel
0 Kudos
Reply
beckettj
Forms Fledgling

Re: Rounding numbers 2 places after decimal within workflow

In regular expression syntax, \d is "a single digit". Therefore you need \d+ (one or more).

Reply
SimonMuntz
Nintex Employee
Nintex Employee

Re: Rounding numbers 2 places after decimal within workflow

@beckettj is correct.

The pattern should be.

\d+\.\d{2}
0 Kudos
Reply