how to do math operation with BigDecimal datatype

One Star

how to do math operation with BigDecimal datatype

Hi,
I just wonder, how do i wants to do mathematics operation (add, subtract, multiply, divide etc) with data type bigdecimal. It such a problem when using float or double since the value will be rounded and makes my calculation inaccurate. My source currently having long decimal places almost 20 decimal point.
Plz help me Smiley Sad

Regards,
Kal
Seven Stars

Re: how to do math operation with BigDecimal datatype

Four Stars

Re: how to do math operation with BigDecimal datatype

HI
You can use setScale() function for bigdecimal help u for rounding or setting the scale, below is the screen shot
thanks
Anil Kumar Burri

Re: how to do math operation with BigDecimal datatype

Dear All, I am trying to read value of a column from a file. The value is something like this 3425876767642397. Yes such big number. I tried using long with length as 10. The job runs fine but the in the output it gives me some weird number and not the one from input. Pls advice whats the data type to be used for such huge numbers.
Regards
Sanjay
One Star

Re: how to do math operation with BigDecimal datatype

Hi All,
I am getting error "The operator + is undefined " in Talent tMap expression editor. Any operation i will do in the expression editor i am facing the same problem.I am using Developer version of Telend 5.4.
Can anybody suggest me what to do ?
Thanks
Ashok
Community Manager

Re: how to do math operation with BigDecimal datatype

Hi All,
I am getting error "The operator + is undefined " in Talent tMap expression editor. Any operation i will do in the expression editor i am facing the same problem.I am using Developer version of Telend 5.4.
Can anybody suggest me what to do ?
Thanks
Ashok

It is a Java compilation error, what's the data type of column? Can you please show us the expression?
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: how to do math operation with BigDecimal datatype

 hii
I'm trying to perform arithmetic operation on one of my columns. when i compile i'm getting a java compilation error 
my column data type is BigDecimal. Someone please help me to solve this.
thankyou                                                                             
One Star

Re: how to do math operation with BigDecimal datatype

 hii
I'm trying to perform arithmetic operation on one of my columns. when i compile i'm getting a java compilation error 
my column data type is BigDecimal. Someone please help me to solve this.
thankyou                                                                             

Hi Naveen
Are you able to resolve this issue