Hi all,
What is the best practice to add the parentheses in a negative number to be "-40,000" to be "(40,000)"?
I'm new to this tool and appreciate your help.
Thank you in advance
Solved! Go to Solution.
I would do it with a formula like this
Hi DavidP
It works perfectly. Many thanks for your support, really appreciate it!!
@DavidP
How do we do this when we have the number in 'double' format? Its giving me an error saying - Error: Formula (18): The formula "" resulted in a string but the field is numeric. Use ToNumber(...) if this is correct. (Expression #1)
Using ToNumber doesnt help as it converts the string to 0.
Hi @sushantsane
Numeric formats such as Double does not support brackets or 1000 separators. You therefore have to change the data type to a string first.
That does not work. Since the if statement expects a number to use, throwing up error that it needs the data in number format !
Hi @sushantsane
In my example above, the field [number] is a numeric datatype - double would work here - but the field [new number] is a Text data type, since you're adding non-numeric characters.
[new number] is the new field created in the formula tool.
I'm guessing that there might actually be 2 errors in the formula tool:
1. When I see double quotes "" it usually suggests that a new field is being created in a formula tool, but that a name for the new field was not entered
2. The results of the if statement is a Text value, but the datatype of the new field is specified as a numeric type such as Double.
If you can attach your workflow, I can take a look.
Hi DavidP,
Thanks for sharing the formula. I am wondering how to convert the negatif number as indicated in the exemple to (40 000) without ",".
Thanks for your insights !
Best
Olivia
[Solved] for anyone has the same issue as me, please refer to this solution.
https://community.alteryx.com/t5/Forum-Francais/separateur-de-milliers/td-p/408445#
Best
Olivia
thank you so much! I try to use the same formula but there is an error showing "resulted in a string but the field is numeric...Use ToNumber() if this is correct. May I know what shall I do to solve this data type error?
Fyi, my current data type should be "double"
thanks!