Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Pad Left with Zeros in Formula Language

Posted on 2001-09-12
3
Medium Priority
?
1,438 Views
Last Modified: 2013-12-18
In Lotus Notes R5 designer, we have a field that is defined as text, editable.  It represents a number.  We want it to be a full 8 characters, and if the user keys in less than 8 characters, we want to pad it automatically on the left with zeros.  Example: if user keys 12345, we want to automatically make it to be 00012345.  

What is the Formula Language (@...) command to pad left with zeros to a specific number of total characters?
0
Comment
Question by:blyons48
  • 2
3 Comments
 
LVL 10

Accepted Solution

by:
zvonko earned 200 total points
ID: 6478115
if you can go for sure that your content never get longer than 8 chars, than use this formula for InputTranslation:
@Right("00000000"+@Text(myFieldName);8)

Because you have no automatic validation in text field for numbers do it on your own in InputValidation with this formula:
@If(@Right("00000000"+@Text(@TextToNumber(myFieldName));8)!=myFieldName;@Failure("Not a Number");@Success)

Is this wath you are looking for?

Regards,
zvonko

0
 

Author Comment

by:blyons48
ID: 6479343
Wonderful!  I tried both the Input translation and Input validation formulas which you provided, and they are perfect for what I wished to accomplish.   Thank you so much.
0
 
LVL 10

Expert Comment

by:zvonko
ID: 6481923
tahk you for the points and for the feedback <|;-)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Integration Management Part 2
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question