Skip to main content
Nintex Community Menu Bar

Rounding numbers 2 places after decimal within workflow

  • November 21, 2019
  • 8 replies
  • 50 views

Forum|alt.badge.img+10

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

 

Cheers

mai-kel

8 replies

Forum|alt.badge.img+10
  • Author
  • Nintex Partner
  • November 21, 2019
Regular expression anyone?! :)

Forum|alt.badge.img+12
  • Scholar
  • November 21, 2019

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

 

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

 

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


Forum|alt.badge.img+10
  • Author
  • Nintex Partner
  • November 21, 2019

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

5615i84D67BF161CEB0C7.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. : /


Forum|alt.badge.img+12
  • Scholar
  • November 21, 2019

@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?


Simon Muntz
Nintex Partner
Forum|alt.badge.img+23
  • Nintex Partner
  • November 22, 2019

Hi,

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

d.d{2}

Seems to work.

5621i3D37AA892D5A348F.png

 


Forum|alt.badge.img+10
  • Author
  • Nintex Partner
  • November 28, 2019
Hi Simon,

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

Cheers
mai-kel

beckettj
Forum|alt.badge.img+5
  • November 28, 2019

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


Simon Muntz
Nintex Partner
Forum|alt.badge.img+23
  • Nintex Partner
  • November 28, 2019

@beckettj is correct.

The pattern should be.

d+.d{2}