?
Solved

Pad Left with Zeros in Formula Language

Posted on 2001-09-12
3
Medium Priority
?
1,429 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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 you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

762 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