-1

While developing Talend job using tMap, I am in need of executing zero padding of a field that contains numbers (example: 1542) and is of 20 characters length.

  1. Will my proposed formula

StringHandling.STR('0',20-(StringHandling.LEN(row1.eno)))+row1.eno

work?
  1. If not, what would be the best way to do so?
Rownum Highart
  • 187
  • 1
  • 13
  • 1
    Please specify and format your question & code according to: https://stackoverflow.com/help/how-to-ask – bitski Nov 28 '21 at 22:48

2 Answers2

1

Why don't you use StringHandling.LPAD(row1.eno, 20, '0') or something of a kind? Left zero padding is what you require, if I understood you correctly...

R

Rownum Highart
  • 187
  • 1
  • 13
0

A simple String.format() can do that :

String.format("%020d",row1.eno)
RealHowTo
  • 34,977
  • 11
  • 70
  • 85