public final class EngineeringFormatter 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 | Method and Description |
---|---|
static String |
convertToEngineering(String in)
Make the exponent of a floating point value a multiple of 3.
|
static String |
format(double val)
Format a double in Engineering format using
DEFAULTSIZE room. |
static String |
format(double val,
int room)
Format a double in Engineering format.
|
static String |
padd(String in,
int width)
Extend a String with spaces, or trim it to reach a specified length.
|
static void |
setUpperCaseFormat(boolean upper)
Switch to/from upper case E for exponent indicator.
|
public static void setUpperCaseFormat(boolean upper)
upper
- boolean; if true; an upper case E will be used; if false; a lower case e will be usedpublic static String format(double val)
DEFAULTSIZE
room.val
- double; the value to formatpublic static String format(double val, int room)
val
- double; the value to formatroom
- int; the width in characters of the result (minimum value is 10; values below this limit will be treated as
10)public static String convertToEngineering(String in)
in
- String; String representation of a floating point valueCopyright © 2015–2018 Delft University of Technology. All rights reserved.