Skip to main content
Solved

Complete field with 0 in the left

  • May 15, 2023
  • 3 replies
  • 28 views

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.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

geomancer
Evangelist
Forum|alt.badge.img+58
  • Evangelist
  • 932 replies
  • May 16, 2023

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

PadLeft


david_r
Celebrity
  • 8392 replies
  • 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
  • 145 replies
  • May 16, 2023

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

PadLeft

Very Good, thank´s for your attention!