Package org.djunits.value.formatter
Class Format
java.lang.Object
org.djunits.value.formatter.Format
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-2024 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
Modifier and TypeFieldDescriptionstatic final int
Default total width of formatted value. -
Method Summary
-
Field Details
-
DEFAULTSIZE
public static final int DEFAULTSIZEDefault total width of formatted value.- See Also:
-
-
Method Details
-
format
Format a floating point value.- Parameters:
value
- double; the value to format- Returns:
- String; the formatted floating point value
-