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,
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 ';'.
Looks like it will do the job. It isn't working for me when I use references though. Here's the configuration.
I get NaN as the result though. Any ideas?
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.
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.
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 '.'.
It is a number field.
As a follow up to Eric's post, do you know what else could cause the result to be 'Nan'?
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.
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?
In addition, here is the screen shot:
Retrieving data ...