Convert String in parenthesis to Negative Number

Hello! Knime newbie. How can I convert a string in this format (1,000.00) to a negative number?

Thanks in advance!

Hi @arodil Welcome to the forum

Use a String Manipulation node with:
removeChars( (replace($column1$,"(" ,"-" ) ) ,")" )
and after that a String to Number node

gr. Hans

2 Likes

You can use String Manipulation node with this expression:

regexReplace("$column1$","\\(([^\\(\\)]*)\\)" ,"-$1" )

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.