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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
_AnonymousUser
Specialist III
Specialist III

[resolved] Round a number

Hello,
I read in a tMap an Excel cell who can be "null" or contain a number with delimiter (1 111) and can be décimal (1 111,11...111).
The input format is string, the input format is string.
I try getting the number like that :
9 876 543 --> 9876543 (without separator)
or
1 234 567,55 -> 1234568 (without separator and rounded)
Then I test that :
Relational.ISNULL(row11.newColumn8)?"" 0683p000009M9p6.pngtringHandling.CHANGE(row11.newColumn8," ","")
For the separator, it's ok, but I cannot round the number.
Please, help me ...
Thank-you
Quartz92
Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

6 Replies
Anonymous
Not applicable

In order to round the number, first you will have to change the data type to decimal and then apply round function
Vaibhav
_AnonymousUser
Specialist III
Specialist III
Author

Thank-you sanvaibhav,
The decimal data type to use is "integer" ?
Then I must do :
Relational.ISNULL(row11.newColumn8)?"":ConvertTypes.String2Int(StringHandling.CHANGE(row11.newColumn8," ",""))
to convert before use round ?
I don't find a round function to use in a tMap.
Do you have more instructions to help me ?
Thank-You !!
Anonymous
Not applicable

_AnonymousUser
Specialist III
Specialist III
Author

Thank-you sanvaibhav,
The two metods you purpose are in Java ... is it possible to do the same thing in a tMap Talend ?
Anonymous
Not applicable

You can use Java anywhere possible in Talend...
Yes, you can use it tMap as well... Use Ctrl+Space you can get inbuild java functions/routines implemented by talend..
Vaibhav
_AnonymousUser
Specialist III
Specialist III
Author

Thank-you sanvaibhav !!