public class Formats extends Object
Modifier and Type | Method and Description |
---|---|
static String |
formatDecimal(double value,
int dp)
Turns a floating point value into a string with a given number of
decimal places using standard settings.
|
static String |
formatDecimal(double value,
String format)
Turns a floating point value into a formatted string using standard
settings.
|
static String |
formatDecimalLocal(double value,
int dp)
Turns a floating point value into a string using current locale settings.
|
static String |
formatDecimalLocal(double value,
String format)
Turns a floating point value into a formatted string using current
locale settings.
|
public static String formatDecimal(double value, int dp)
value
- value to formatdp
- number of decimal places (digits after the decmal point)public static String formatDecimalLocal(double value, int dp)
formatDecimal
function.value
- value to formatdp
- number of decimal places (digits after the decmal point)public static String formatDecimal(double value, String format)
format
string is as defined by Java's
java.text.DecimalFormat
class.value
- value to formatformat
- format specifierpublic static String formatDecimalLocal(double value, String format)
formatDecimal
function.value
- value to formatformat
- format specifierCopyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.