Here you can find the source of zeroSupply(String value, int len)
public static String zeroSupply(String value, int len)
//package com.java2s; /******************************************************************************* * @(#)DateFormatUtil.java 2012-3-12/*w w w . java 2 s.c o m*/ * * Copyright 2012 Neusoft Group Ltd. All rights reserved. * Neusoft PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. *******************************************************************************/ public class Main { public static String zeroSupply(String value, int len) { if (value == null) { return value; } String supply = ""; for (int i = value.length(); i < len; i++) { supply = supply + "0"; } return supply + value; } }