public class NumberToStringConverter extends Object
Constructor and Description |
---|
NumberToStringConverter(int maxNumberToRepresent)
Creates with a constant width just enough to be able to represent
maxNumberToRepresent . |
Modifier and Type | Method and Description |
---|---|
String |
convert(int number)
Converts
number to a string, padding with leading zeros if necessary to ensure the
desired width. |
public NumberToStringConverter(int maxNumberToRepresent)
maxNumberToRepresent
.maxNumberToRepresent
- the maximimal number that needs to be converted.public String convert(int number)
number
to a string, padding with leading zeros if necessary to ensure the
desired width.number
- the number to convert to a stringnumber
, maybe padded with leading zerosCopyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.