Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Im currently doing a job with 2 tFileInputExcel and joining them with TMAP.
Im getting stuck in the values parsing
In my XLS file i got values such as
| 2.382,35 |
| 30,25 |
| 61,61 |
When i use tLogRow to see that data
2382,349999999999 |
30,249999999999993 |
61,60999999999999 |
First i need to replace the "," to "." to convert this String to Double
When i make that some numbers appears correctly as
2317.35
and others still the same formation
2382.349999999999
Then im getting Null Exception and trying to Double.parseDouble(Variable)
java.lang.NullPointerException
I need to numbers be with 00.00 (Only 2 decimal places, can be rounded)
There is a way to check with the field "Value" is number to be possible to convert to Double? I think im getting some trash in this process, maybe a alpha that cant be transformed to double.
like (if is a number do convert, if not ignore)
Can someone help me?
Hi,
I was able to do the same. Please refer the details below.
row1.data.replaceAll("\\.","").replaceAll(",",".")
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Hi,
I was able to do the same. Please refer the details below.
row1.data.replaceAll("\\.","").replaceAll(",",".")
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Perfect!
Please spare a second to mark the topic as resolved as it will help others also.
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
I mark this on my tFileInput too, to avoid this stuff later