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

Announcements
Discover the Trends Shaping AI in 2026: Register Here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Parse Double

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?

0683p000009M66m.png0683p000009M66w.png

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi,

 

   I was able to do the same. Please refer the details below.

0683p000009M619.png

 

0683p000009M67G.png

 

0683p000009M67L.png

 

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 🙂

 

View solution in original post

4 Replies
Anonymous
Not applicable
Author

Hi,

 

   I was able to do the same. Please refer the details below.

0683p000009M619.png

 

0683p000009M67G.png

 

0683p000009M67L.png

 

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 🙂

 

Anonymous
Not applicable
Author

Thanks for your repply i will try it, but i found a error in my input XLS, somehow the lines after the content has some invalid data, i cleared all the stuff and works perfectly using my way, but thanks for your repply i will try it too, i think is better
Anonymous
Not applicable
Author

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 🙂

Anonymous
Not applicable
Author

I mark this on my tFileInput too, to avoid this stuff later

 

0683p000009M5nh.png