Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Pad Left with Zeros in Formula Language

Posted on 2001-09-12
5
Medium Priority
?
536 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
  • 2
5 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 6476627
Write this code in Input translation of the field,
max := 8;
len := @Length(num);
@if(len >= max; @left(num;max); @Repeat("0"; max-len) + num)

~Hemanth
0
 
LVL 1

Accepted Solution

by:
SAK earned 200 total points
ID: 6476869
Try:
@Right("00000000"+inputfld;8)


SAK
0
 

Author Comment

by:blyons48
ID: 6477230
SAK...your solution did the trick...simple and effective...thanks!
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 6477694
What ?
0
 

Author Comment

by:blyons48
ID: 6482683
HermanthaKumar,
Ah!  I just tried your solution as well, and it works too, and even more sophisticated than SAK's simple one-line solution.  I guess I just jumped on the simpler looking one.  I apologize.  If I could somehow share the points between both of your good working solutions, I would.  But I've already submitted the Accept Answer.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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…
  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…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

598 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