how to rounding number in the tmap

One Star

how to rounding number in the tmap

hi all i want to rouding double value in 

double 32.62 to 32.5 in to databse not done 
double 32.62 to 32 in to database done
float 32.62 in 33 in to database done 
double 32.62 in 32 and 62 in separeted rows or columns in database not done
double 32.62145 in 32.6 , 32.62 , 32.621 , 32.622 in separeted rows or columns in databse  not done 

date 10012015 in 10012016 done 
date 10012015 in 10022015 done
date 10012015 in 17012016 done 
date 10012015010000 in 10012015 done
date 32022015 in error because the date is not existent not done 

help me thanks all
and sorry for my bad english.

Re: how to rounding number in the tmap

You'll need to use the java.lang.Math Round method:
for example if you have your double in the row1.double_column, to round double 32.62145 to 32.6 you would write:
java.lang.Math.round(row1.double_column * 10) / 10.0;

What’s New for Talend Spring ’19

Join us live for a sneak peek!

Sign up now


Introduction to Talend Open Studio for Data Integration.


Downloads and Trials

Test drive Talend's enterprise products.


Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.