[resolved] How to convert float to integer in tMap ?

One Star

[resolved] How to convert float to integer in tMap ?

Hello
How to convert float (AS400) column to integer (Postgres) column in tMap ?
I tried several methods without success :-(
Thanks

Accepted Solutions
Seventeen Stars

Re: [resolved] How to convert float to integer in tMap ?

hi,
have a look at :
 http://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html#parseInt(java.lang.String)
It give you the method in java 
ps : you can also do something like 'java String to integer' in google Smiley Wink  or look for similar post in Talend forum with the option Search ....
regards
laurent

View solution in original post


All Replies
Highlighted
Community Manager

Re: [resolved] How to convert float to integer in tMap ?

Hello
try
(int)row1.columnName

Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] How to convert float to integer in tMap ?

thanks a lot Shong, it works !
I don't understand why i haven't try this before...
Two Stars

Re: [resolved] How to convert float to integer in tMap ?

how to convert string 0.15 into integer?
thanks and regards
Syed
Six Stars

Re: [resolved] How to convert float to integer in tMap ?

Integer.parseInt(yourstring);
Seventeen Stars

Re: [resolved] How to convert float to integer in tMap ?

hi,
have a look at :
 http://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html#parseInt(java.lang.String)
It give you the method in java 
ps : you can also do something like 'java String to integer' in google Smiley Wink  or look for similar post in Talend forum with the option Search ....
regards
laurent

View solution in original post

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