Skip to main content
Solved

Complete field with 0 in the left


mr_fme
Enthusiast
Forum|alt.badge.img+9

Hi,

 

I have some field (ID), but the values sometimes have one, two, three...digits. There is one attribute with number of the digits that previous may have. For example the value (ID) is 10 and the number of digits may have 5, so the value is 00010. If the value (ID) is 1555, the value become 01555.

 

How to put 0 in the left to complete the digits of fields?

 

How do that?

 

Thank´s

 

Best answer by david_r

Or use the StringFormatter, with e.g. "05s" as the format string.

View original
Did this help you find an answer to your question?

3 replies

geomancer
Evangelist
Forum|alt.badge.img+50
  • Evangelist
  • May 16, 2023

Use the @PadLeft function in an AttributeManager or AttributeCreator, of use the StringPadder transformer.

PadLeft


david_r
Celebrity
  • Best Answer
  • May 16, 2023

Or use the StringFormatter, with e.g. "05s" as the format string.


mr_fme
Enthusiast
Forum|alt.badge.img+9
  • Author
  • Enthusiast
  • May 16, 2023
geomancer wrote:

Use the @PadLeft function in an AttributeManager or AttributeCreator, of use the StringPadder transformer.

PadLeft

Very Good, thank´s for your attention!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings