Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6066127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:28:02+00:00 2026-05-23T09:28:02+00:00

I have file that are uploaded which are formatted like so MR 1 MR

  • 0

I have file that are uploaded which are formatted like so

MR 1

MR 2

MR 100

MR 200

MR 300

ETC.

What i need to do is add extra two 00s before anything before MR 10 and add one extra 0 before MR10-99

So files are formatted

MR 001

MR 010

MR 076

ETC.

Any help would be great!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:28:03+00:00Added an answer on May 23, 2026 at 9:28 am

    Assuming you have those values stored in some strings, try this:

    function pad (str, max) {
      str = str.toString();
      return str.length < max ? pad("0" + str, max) : str;
    }
    
    pad("3", 3);    // => "003"
    pad("123", 3);  // => "123"
    pad("1234", 3); // => "1234"
    
    var test = "MR 2";
    var parts = test.split(" ");
    parts[1] = pad(parts[1], 3);
    parts.join(" "); // => "MR 002"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently I have an application that receives an uploaded file from my web application.
I now have a file uploader that goes on like this This is the
I have csv file that looks like this: artist,year,id,video_name,new_video_id,file_root_name,video_type ,,,,,, Clay Aiken,1,clay_aiken,Sorry Seems To
I have a file that looks something like this def foo bar {{ //
Right now I have a function which takes my uploaded file, checks the extension,
I have a file that I want to include in Python but the included
I have a file that lists filenames, each on it's own line, and I
We have a file that has a 64 bit integer as a string in
I have a file that apparently contains some sort of dump of a keep-alive
I have a file that has one entry per line. Each line has the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.