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.

Thirteen 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

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.

Thirteen 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
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()))