Workflow Number Formatting

  • 12 March 2015
  • 7 replies
  • 4 views

Badge +7

Are there any built in functions that provide number formatting?  We are looking to format with parenthesis for negative numbers and commas.

 

Thanks in advance,

Eric


7 replies

Badge +9

Hi Eric

in workflow You can use Query XML action to format numbers, e.g.

As You see You can also do calculations. The first pattern will be used for positive numbers and the second for negative numbers. Pattern separator is ';'.

Kind regards

Manfred

Badge +7

Hi Manfred,

Looks like it will do the job.  It isn't working for me when I use references though.  Here's the configuration.

3-12-2015 9-51-47 AM.jpg

I get NaN as the result though.  Any ideas?

Thanks again,

Eric Halsey

Userlevel 5
Badge +12

Hi Eric,

Are you using the Run Now function and seeing this "NaN" value?   This will happen because your variable will not be parsed correctly when using the Run Now function.   If you publish the workflow and run it live, it should work fine if that is the root of the problem.


Thanks,

Mike

Badge +7

Hi Mike,

When I tested using run now I replaced the token with an actual value and it worked as expected.  I get the NaN when the workflow is executed.  I'm wondering if anyone has used it like I did, with the token, or if they were just using numeric literals in the XML.

Regards,

Eric

Badge +9

Hi Eric

what type of variable You have used for input numbers? What numbers have You used in test?

Please note that format-number is designed to take an "international format" number as input,i.e decimal-separator has to be '.'.

Kind regards

Manfred

Badge +7

It is a number field.

Userlevel 5
Badge +12

Nan refers to "Not a number" so you'll get this error whenever it detects any text that is not a number.  This could include things such as "," if it is being treated as a string rather than a decimal number.

Reply