Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
SR2210
Contributor
Contributor

Round up nullable Double

Hi All,

I extract my data in type String and I need to store them in database as numeric. The data contains decimal numbers and NULL.

For decimal numbers, I need to round up the values to the nearest integer. For example, 4.3145 will be 4 and for NULL i need it to show as NULL in database.

I tried to use Math.Round() function in tMap as below but it throws an error -

0693p000009ShNMAA0.jpg

0693p000009ShNvAAK.jpg

I searched and found out that Math.Round() won't work for a nullable Double 😞

Can anyone suggest a way that i can round up the decimal numbers and also load the NULL values in database?

Labels (5)
2 Replies
manodwhb
Champion II
Champion II

@Syaheerah Radzi​ ,check the below link. you need to write tjava

 

https://www.tutorialspoint.com/java/lang/math_round_double.htm

 

Thanks,

Manohar

vikramk
Creator II
Creator II

Hi  SR2210,

You could achieve this even by using tConverttype component, please go through below link:

https://help.talend.com/reader/mjoDghHoMPI0yuyZ83a13Q/7wzgYBYjU0kmyizKfM_7Gw