Solved

Pad Left with Zeros in Formula Language

Posted on 2001-09-12
3
1,402 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
Comment Utility
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
Comment Utility
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
Comment Utility
tahk you for the points and for the feedback <|;-)
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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…
Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

743 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

15 Experts available now in Live!

Get 1:1 Help Now