Solved

Pad Left with Zeros in Formula Language

Posted on 2001-09-12
3
1,408 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 50 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Missing Rules 1 294
Find and delete local contacts in names.nsf 5 178
Migration: Lotus Notes to Exchange 2013 10 325
Notes > Exchange calendar issues 5 61
You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

896 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now