Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static String formatNumber(int number) {

        String string = new String();

        if (number < 10) {
            string = "00" + number;
        } else if (number >= 10 && number < 100) {
            string = "0" + number;
        } else {
            string = String.valueOf(number);
        }

        return string;
    }
}