I get csvs and one column has an average in a strange format.
e.g. 12223.8 or 23422.99999999999
I would like to store 12223 or 23422 instead.
How can I remove the dot and everything after?
Solved! Go to Solution.
When I try Double.parseDouble(row1.data).intValue() I get an error.
Detail Message: The method parseDouble(String) in the type Double is not applicable for the arguments (Double)
below code will give you an idea how to remove all character after dot from a decimal value.
Double a = 23422.99999999999; System.out.println(a.intValue()); String b = "23422.99999999999"; System.out.println((int)Double.parseDouble(b));
You can write the above code in tjava component and run it.
Please give Kudos and mark topics as solved where appropriate.
I'm new to Talend, but my next project involves a lot of csv imports and I think Talend would be the right tool for it, just need to understand it better.
Right now I kinda a bit feel stupid, because nothing seems to work.
Is there something I could do wrong with the csv?
tMap always throws an error, even when I say the data in the csv is double and I just want to save it in my DB as double without any cast.
Both (input / output) double "can't cast from int to double"
csv double - target int - using your tips "can't cast from string to int"
Talend named a Leader.
Kickstart your first data integration and ETL projects.
Learn how to do cool things with Context Variables
Find out how to migrate from one database to another using the Dynamic schema
Pick up some tips and tricks with Context Variables