public class Formatter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.text.NumberFormat |
floatFormatter
The one-and-only static instance of a
NumberFormat
formatter using the US locale and having a minimum fraction digit
count of 1.WARNING: DO NOT CHANGE ANY PROPERTIES OF THIS FORMATTER! This is a static object, beeing shared between multiple objects! |
Constructor and Description |
---|
Formatter() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
ensureLength(java.lang.String in,
int len,
char filler,
boolean append)
Ensures that the given String has at least the given length.
Please note that longer Strings are NOT truncated! |
static java.text.NumberFormat |
getNewFloatFormatter() |
public static final java.text.NumberFormat floatFormatter
NumberFormat
formatter using the US locale and having a minimum fraction digit
count of 1.public static java.lang.String ensureLength(java.lang.String in, int len, char filler, boolean append)
in
- The String to be processedlen
- The minimum Length of the returned Stringfiller
- The character to be used for filling up the missing lenghtappend
- If true
the necessary filling characters
will be appended to the given String, otherwise the filling happes by prefixing the String.public static java.text.NumberFormat getNewFloatFormatter()
NumberFormat
object using the US
locale. It's save to change the formatting options of this object.