cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Workflow Number Formatting

Jump to solution

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

Labels: (1)
0 Kudos
Reply
10 Replies
Workflow Hero

Re: Workflow Number Formatting

Jump to solution

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

Reply
Workflow Hero

Re: Workflow Number Formatting

Jump to solution

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

0 Kudos
Reply
Workflow Hero

Re: Workflow Number Formatting

Jump to solution

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

0 Kudos
Reply
Workflow Hero

Re: Workflow Number Formatting

Jump to solution

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

0 Kudos
Reply
Workflow Hero

Re: Workflow Number Formatting

Jump to solution

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

0 Kudos
Reply
Workflow Hero

Re: Workflow Number Formatting

Jump to solution

It is a number field.

0 Kudos
Reply
Not applicable

Re: Workflow Number Formatting

Jump to solution

Manfred,

As a follow up to Eric's post, do you know what else could cause the result to be 'Nan'?

0 Kudos
Reply
Workflow Hero

Re: Workflow Number Formatting

Jump to solution

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.

0 Kudos
Reply
Not applicable

Re: Workflow Number Formatting

Jump to solution

Mike,

Since It is a number field, how would it be possible to detect anything else other than a number? Taking step back, does the number field have to first be stored in a variable?

Thanks,

Francisco

0 Kudos
Reply