Format.java
package org.djunits.value.formatter;
/**
* Format a floating point number in a reasonable way. <br>
* I've experienced problems with the %g conversions that caused array bounds violations. Those versions of the JRE that do
* <b>not</b> throw such Exceptions use one digit less than specified in the %g conversions. <br >
* TODO check how to always format numbers corresponding to the Locale used.
* <p>
* This file was generated by the djunits value classes generator, 26 jun, 2015
* <p>
* Copyright (c) 2015-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
* BSD-style license. See <a href="http://djunits.org/docs/license.html">DJUNITS License</a>.
* <p>
* $LastChangedDate: 2018-01-28 03:17:44 +0100 (Sun, 28 Jan 2018) $, @version $Revision: 256 $, by $Author: averbraeck $,
* initial version 26 jun, 2015 <br>
* @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
* @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a>
*/
public final class Format
{
/**
* This class shall never be instantiated.
*/
private Format()
{
// Prevent instantiation of this class
}
/** Default total width of formatted value. */
public static final int DEFAULTSIZE = 10;
/**
* Format a floating point value.
* @param value double; the value to format
* @return String; the formatted floating point value
*/
public static String format(final double value)
{
return EngineeringFormatter.format(value, DEFAULTSIZE);
}
}