public final class Formatter extends Object
Copyright (c) 2015-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUNITS License.
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULTPRECISION
Default number of fraction digits.
|
Modifier and Type | Method and Description |
---|---|
static String |
format(double value,
int size)
Format a floating point value.
|
static String |
format(double value,
int width,
int precision)
Format a floating point value.
|
static String |
format(float value)
Format a floating point value.
|
static String |
format(float value,
int size)
Format a floating point value.
|
static String |
format(float value,
int width,
int precision)
Format a floating point value.
|
(package private) static String |
formatString(int width,
int precision,
String converter)
Build a format string.
|
public static final int DEFAULTPRECISION
static String formatString(int width, int precision, String converter)
width
- int; the number of characters in the resultprecision
- int; the number of fractional digits in the resultconverter
- String; the format conversion specifierpublic static String format(float value, int width, int precision)
value
- float; the value to formatwidth
- int; the number of characters in the resultprecision
- int; the number of fractional digits in the resultpublic static String format(float value, int size)
value
- float; the value to formatsize
- int; the number of characters in the resultpublic static String format(float value)
value
- float; the value to formatpublic static String format(double value, int width, int precision)
value
- double; the value to formatwidth
- int; the number of characters in the resultprecision
- int; the number of fractional digits in the resultpublic static String format(double value, int size)
value
- double; the value to formatsize
- int; the number of characters in the resultCopyright © 2015–2018 Delft University of Technology. All rights reserved.