a problem with rounding a series of numbres

One Star

a problem with rounding a series of numbres

Hi,
i've a problem with rounding a series of numbres.
for exemple :
1|2012|1|1.7108333333333332|6.591666666666668|50.5225|2.098333333333333|33394.35
i've tried with "tmap", and the expression was DataOperation.FIX(value)
It worked and i've got this resulat :
1|2012|1|2.0|7.0|51.0|2.0|33394.0

but i would like to keep the 2 last numbre after the decimal,
just like
1|2012|1|1.71|6.59|50.52|2.10|33394.35
i have tried with DataOperation.FIX(value,2) and (DataOperation.FIX(value*100))/100
it didn't work...
and does anyone can help me?? where can i set up the precision?
thanks
Miao
One Star

Re: a problem with rounding a series of numbres

Hi Miao
Just modify the schema of input component as the following images.
Regards,
Pedro
One Star

Re: a problem with rounding a series of numbres

hi,
how are you?

i've modified the schema of input component, but there is a error :
The method FIX(double) in the type DataOperation is not applicable for the arguments (BigDecimal)...
One Star

Re: a problem with rounding a series of numbres

Hi Miao
I'm fine. Smiley Wink
Create job as follow.
tFileInputDelimited --> tLogRow
There is no need to use FIX() method here.
Hope this can help you.
Regards,
Pedro
One Star

Re: a problem with rounding a series of numbres

Can i send a mail to you with my job, because i have other components before this step...
Hi Miao
I'm fine. Smiley Wink
Create job as follow.
tFileInputDelimited --> tLogRow
There is no need to use FIX() method here.
Hope this can help you.
Regards,
Pedro
One Star

Re: a problem with rounding a series of numbres

Hi
No problem. Just send it to me.
Regards,
Pedro
One Star

Re: a problem with rounding a series of numbres

Hi
How about the problem?
Is that solved?
I'm in same problem.
I use TOS v5.1.1.

Calling Talend Open Studio Users

The first 100 community members completing the Open Studio survey win a $10 gift voucher.

Start the survey

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

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download