
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How can I check for a decimal number in talend
How can I check for a decimal number with up to 12 places before decimal and precision of up to 3 places after the decimal. without the currency symbol and without comma separators

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Could you please elaborate your case with an example with input and expected output result?
Best regards
Sabrina

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying write a variable that verify my input data is three digit decimal like this 123456789012.121within tmap, if it is not three digit then I will write out an error code. ? 1 : 0
Thanks
Hank

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Hank Okoro ,
Please use below formula in tmap expression
StringHandling.LEN(row1.value) - (StringHandling.INSTR(row1.value,".",1,1)) to calculate length after decimal point
StringHandling.LEN(row1.value) - (StringHandling.INSTR(row1.value,".",1,1)) != 3 ? 1 : 0 to flag the value based on your requirement
|value |decimal_value|count_flag|
|=-------------+-------------+---------=|
|123345.567 |3 |0 |
|2345678905.789|3 |0 |
|6474747457.67 |2 |1 |
'--------------+-------------+----------'
Thanks & Regards,
Madhu Kolli
