Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all
i have row in csv which has below data ,i want to insert decimal point after the starting two digits
i am using Tmap
number1
12355
23455
26463
35535
Expected:
number1
12.35
23.45
26.46
35.53
Thnks
Hi Sushil,
Please add another LEFT function as a quick option to limit the output to first five characters.
StringHandling.LEFT(StringHandling.LEFT(row1.input,2)+"."+StringHandling.RIGHT(row1.input,StringHandling.LEN(row1.input)-2),5)
If the solution has helped you, could you please mark the topic as resolved? Kudos are also welcome 🙂
Warm Regards,
Nikhil Thampi
Hi,
Please read the value as string to a tmap and use the below function.
StringHandling.LEFT(row1.input,2)+"."+StringHandling.RIGHT(row1.input,StringHandling.LEN(row1.input)-2)
Note:- Please add additional checks to handle NULL and strings whose length are less than 2 if required.
Once the conversion is over, you can convert the string to Double if the target is looking for that option.
Warm Regards,
Nikhil Thampi
Thank you
But you missed limiting to two digits after decimal point.please check my expected output
Hi Sushil,
Please add another LEFT function as a quick option to limit the output to first five characters.
StringHandling.LEFT(StringHandling.LEFT(row1.input,2)+"."+StringHandling.RIGHT(row1.input,StringHandling.LEN(row1.input)-2),5)
If the solution has helped you, could you please mark the topic as resolved? Kudos are also welcome 🙂
Warm Regards,
Nikhil Thampi