Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] CONVERT STRING TO INTEGER

Hello All,
I want to convert my input column (String type) to Integer in my tMap
In my input i have these values for exemple
"0.23"
"2.45"
"9.57"
So i test these both function:   Integer.parseInt()  or Integer.valueOf().
But it does not. I also change all dot to comma in input like that:
"0,23"
"2,45"
"9,57"
But nothing
Thanks for help,
Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi IDEMBELE,
What error does the console state when running your small test job?
Also, the Integer data type cannot hold decimal values, only the whole numbers. I think that is whats causing the error. You have to either:

change input values to whole numbers; or
change Integer data type to float or some other similar data type that handles decimals

View solution in original post

4 Replies
Anonymous
Not applicable
Author

You probably need to get rid of the quotes first.
Anonymous
Not applicable
Author

Hi janhess2,
I am not sure because i make test with a small job but it does not work.
See the screenshot of job please
0683p000009MDBi.jpg
And down the config of tFixeFlowInput component
0683p000009MDEs.jpg
Thanks for help,
Anonymous
Not applicable
Author

Hi IDEMBELE,
What error does the console state when running your small test job?
Also, the Integer data type cannot hold decimal values, only the whole numbers. I think that is whats causing the error. You have to either:

change input values to whole numbers; or
change Integer data type to float or some other similar data type that handles decimals
Anonymous
Not applicable
Author

Thanks junmilsso