Here you can find the source of formatTo2Digit(int number)
Parameter | Description |
---|---|
number | the number to format |
private static String formatTo2Digit(int number)
//package com.java2s; /*/*from w w w .j a va 2 s . c o m*/ * EasyCukes is just a framework aiming at making Cucumber even easier than what it already is. * Copyright (C) 2014 Worldline or third-party contributors as * indicated by the @author tags or express copyright attribution * statements applied by the authors. * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License. * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ public class Main { /** * Used to format number in 2 digits * * @param number the number to format * @return the string representation in 2 digit for the given number */ private static String formatTo2Digit(int number) { return number < 10 ? "0" + number : Integer.toString(number); } }