Package org.djunits.value.formatter
Class Format
java.lang.Object
org.djunits.value.formatter.Format
public final class Format extends Object
Format a floating point number in a reasonable way.
I've experienced problems with the %g conversions that caused array bounds violations. Those versions of the JRE that do not throw such Exceptions use one digit less than specified in the %g conversions.
TODO check how to always format numbers corresponding to the Locale used.
I've experienced problems with the %g conversions that caused array bounds violations. Those versions of the JRE that do not throw such Exceptions use one digit less than specified in the %g conversions.
TODO check how to always format numbers corresponding to the Locale used.
Copyright (c) 2015-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUNITS License.
- Author:
- Alexander Verbraeck, Peter Knoppers
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULTSIZE
Default total width of formatted value. -
Method Summary
-
Field Details
-
DEFAULTSIZE
public static final int DEFAULTSIZEDefault total width of formatted value.- See Also:
- Constant Field Values
-
-
Method Details
-
format
Format a floating point value.- Parameters:
value
- double; the value to format- Returns:
- String; the formatted floating point value
-