How to convert negative values to () brackets

Four Stars

How to convert negative values to () brackets

How to convert negative values to () brackets.

-7 to (7)

And i have columns with null values and i need that to insert as null and it should not throw any null error

 

 SRC

ColA  ColB

          2

-1       -7

TGT -- Output

ColA  ColB

          2

(1)     (7)

Highlighted
Forteen Stars

Re: How to convert negative values to () brackets

@ravi777,try this one

(!row3.newColumn1.equals("") || row3.newColumn1!=null) &&row3.newColumn1.contains("-")?"("+row3.newColumn1.replace("-","")+")": row3.newColumn1 

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Forteen Stars

Re: How to convert negative values to () brackets

@ravi777,still do you have this issue?

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch