I’m trying to sum the values from a table column using XPath in a DocuSign CLM document. I already know that this works: <# <Content Select="(sum(//Valor_Por_Data))" /> #>
However, the sum result only works if the numbers are in the format: 00000.00
(no thousands separator, and with a dot . instead of a comma , as the decimal separator).
The issue is that this is not our standard number format — we normally use a thousands separator and a comma for decimals (e.g., 12.345,67).
Is there a way to perform the sum directly with our local number format, or do I need to convert the values before summing them?
Thanks in advance!
Best answer by Pawan Gangwani
Hello @rodvillani
Welcome to the DocuSign Community!
You are absolutely right — the sum() function in XPath expects numbers to be in a specific format: no thousands separator, and using a dot (.) as the decimal separator.
Since your standard format uses a thousands separator (.) and a comma (,) for decimals (e.g., 12.345,67), XPath will not recognize these as valid numbers and will not sum them correctly.
Solution:
Yes, you need to convert the values to a valid numeric format before summing.
Unfortunately, XPath 1.0 (used by DocuSign CLM) does not support advanced string manipulation or locale-aware number parsing. Or better handle it in Workflow.
You are absolutely right — the sum() function in XPath expects numbers to be in a specific format: no thousands separator, and using a dot (.) as the decimal separator.
Since your standard format uses a thousands separator (.) and a comma (,) for decimals (e.g., 12.345,67), XPath will not recognize these as valid numbers and will not sum them correctly.
Solution:
Yes, you need to convert the values to a valid numeric format before summing.
Unfortunately, XPath 1.0 (used by DocuSign CLM) does not support advanced string manipulation or locale-aware number parsing. Or better handle it in Workflow.
You can login or register as either a Docusign customer or developer. If you don’t already have a Docusign customer or developer account, you can create one for free when registering.
You can login or register as either a Docusign customer or developer. If you don’t already have a Docusign customer or developer account, you can create one for free when registering.