Solved

Pad Left with Zeros in Formula Language

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

  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…
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

724 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