Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
TDIALLO
Contributor
Contributor

How i can convert double in Integer

Hi,

How i can convert double to integer(int) in Talend.

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hello @THIERNO DIALLO​ ,

There are 2 possible solutions:

Solution 1:

double data = 3452.345

int value = (int)data;

 

Solution 2:

double data = 3452.345

Double newData = new Double(data);

int value = newData.intValue();

 

View solution in original post

2 Replies
Anonymous
Not applicable

Hello @THIERNO DIALLO​ ,

There are 2 possible solutions:

Solution 1:

double data = 3452.345

int value = (int)data;

 

Solution 2:

double data = 3452.345

Double newData = new Double(data);

int value = newData.intValue();

 

TDIALLO
Contributor
Contributor
Author

hi achen,

 

Thank you for your answer .

My solution is similar to your first suggestion and it works fine.

Thanks again for your feedback.

 

(int) Math.round(my double data)