Skip to main content
Hello

 

 

I have an attribute containting numbers from 1-99 and I would like to add zero in front of the numbers 1-9.

 

 

example:

 

1 -> 01

 

2 -> 02

 

3 -> 03

 

etc.

 

 

Is there an easy way to do this in FME?

 

 

Regards,

 

Stig
Hi,

 

 

There are several way to do that, the easiest will be to add a prefix with the StringPadder, also the StringPairReplacer or the StringReplacer can do the job.

 

 

Itay
Hi Stig,

 

 

Yes, there are several ways. The StringFormatter could be also a quick way.

 

 

Takashi
Hi,

 

 

I used StringFormatter and in Format String Attribute I put 02d.

 

 

In my test case that worked well. I hope that is correct.

 

 

Best regards,

 

Stefan
It seems that Stringpadder with prefix 0 and lenght 2 is working perfectly.

 

 

Thanks a lot for all the answers!

 

 

Stig

Reply