Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
TDIALLO
Contributor II
Contributor II

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 II
Contributor II
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)