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
Solved

Get Count in a variable with 5 digits always

Posted on 2016-11-30
1
42 Views
Last Modified: 2016-11-30
Hi Experts,
    I am looking for a function to get following   in VB.NET

        I have to get a value to a  string variable   in a loop

      For Myint =  1 to 10000
           MyString  should get value from MyInt
      Next

       But the rule is , it should always have 5 digits  . That is ,
            when  Myint = 1 Mystring should be "00001"  
                        Myint = 100 Mystring should be "00100"
               ...
0
Comment
Question by:Sam OZ
1 Comment
 
LVL 51

Accepted Solution

by:
Ryan Chong earned 500 total points
ID: 41908120
try:
MyString = Myint.ToString("00000")

Open in new window

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

Suggested Solutions

Title # Comments Views Activity
Variable Event ? 3 36
EF5: Question about Metadata Artifact Processing 4 22
Disable extension 8 48
Database Connections Not being returned to Connection Pool 7 34
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

856 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