public class IntegerWidth extends Object
To create an IntegerWidth, use one of the factory methods.
NumberFormatter
Modifier and Type | Method and Description |
---|---|
IntegerWidth |
truncateAt(int maxInt)
Truncate numbers exceeding a certain number of numerals before the decimal separator.
|
static IntegerWidth |
zeroFillTo(int minInt)
Pad numbers at the beginning with zeros to guarantee a certain number of numerals before the
decimal separator.
|
public static IntegerWidth zeroFillTo(int minInt)
For example, with minInt=3, the number 55 will get printed as "055".
minInt
- The minimum number of places before the decimal separator.IllegalArgumentException
- if the input number is too big or smaller than 0.NumberFormatter
public IntegerWidth truncateAt(int maxInt)
maxInt
- The maximum number of places before the decimal separator. maxInt == -1 means no
truncation.IllegalArgumentException
- if the input number is too big or smaller than -1.NumberFormatter
Copyright © 2016 Unicode, Inc. and others.