You are viewing limited content. For full access, please sign in.

Question

Question

Format field to have left padded zeros

asked on September 17, 2014 Show version history

is there a way either through field formatting or workflow to have zeroes added to the left of the field value so the total value is say 10 characters ie 111 is enterd but would get filed as 0000000111 or 11111 is entered and would be filed as 0000011111 

0 0

Replies

replied on September 17, 2014

Do you need the actual value to include the leading 0s or do you just need the value to display with leading zeros? If you just want it formatted for display, then setting the field properties in the LF Admin Console is the way to go. If you want to change the values, then you can read them in Workflow, use token formatting to add the extra zeros and then set the values back.

2 0
replied on September 17, 2014 Show version history

 

can be done in admin console in the fields properties window.

 

The actual formatting can be extended to more characters if you add more zeroes. 

1 0
replied on September 18, 2014

I'm looking to use the field with the zeros for naming

1 0
replied on September 18, 2014

if you are using that in a workflow, you will need to enable "Apply Formatting" in the token editor window and put in as many zeroes as you want total characters to get the output to be with the leading zeroes you want

1 0
replied on September 18, 2014

Then I'd go with formatting in Workflow. See this page in the help file for available options for formatting numbers.

1 0
replied on November 21, 2014

Miruna,

 

Very userful link you shared.

In workflow, I can easily pad a number to eight: 

%(HospitalNo_HospitalNo#"00000000"#)

 

Above should work fine when the value is only digits e.g 123 will become 00000123

I could have values like H123 and I have to make it to H0000123 and 123H will become 0000123H and HA123 will become HA000123.

Can you please guide on these?

Thanks

 

0 0
replied on November 21, 2014

0-padding only works for numbers, so you'd need to break your values into numbers and other characters, pad the number and then rebuild the value.

1 0
replied on November 21, 2014

Thanks Miruna. That's what I thought.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.