How can i Convert a row containing the float value (6.60) into the -6.60

Seven Stars

How can i Convert a row containing the float value (6.60) into the -6.60

I have a "*.csv" file with comma separated, containing a row of data type 'FLOAT' with value '(6.60)' , i have to convert this row into '-6.60'

How can i convert this?


Accepted Solutions
Six Stars

Re: How can i Convert a row containing the float value (6.60) into the -6.60

Hi 

You Can use Mathematical.NEG function it will  Returns the arithmetic additive inverse of the value of the argument.

View solution in original post

Forteen Stars

Re: How can i Convert a row containing the float value (6.60) into the -6.60

@meetmahajan,convert float to sting and add "-" before the float to sting expression.

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

View solution in original post


All Replies
Six Stars

Re: How can i Convert a row containing the float value (6.60) into the -6.60

Hi 

You Can use Mathematical.NEG function it will  Returns the arithmetic additive inverse of the value of the argument.

View solution in original post

Forteen Stars

Re: How can i Convert a row containing the float value (6.60) into the -6.60

@meetmahajan,convert float to sting and add "-" before the float to sting expression.

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

View solution in original post

Seven Stars

Re: How can i Convert a row containing the float value (6.60) into the -6.60

Thanks both the solutions working perfectly.

 

Conversion Syntax :  Mathematical.NEG(Double.parseDouble(Variable.replaceAll("\\(", "").replaceAll("\\)","").trim())) 

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 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog