public class DecimalFormatUtil extends Object
Modifier and Type | Method and Description |
---|---|
static String |
doubleToStr(double origin,
int decimals)
Formats a double to produce a string with a number of fraction
digits.
|
static String |
doubleToStr(Number origin,
int decimals)
Formats a Number to produce a string with a number of fraction
digits.
|
static boolean |
isValidDouble(String value,
int decimals)
Tell whether a double string is in valid format, according with
a number of fraction digits.
|
static boolean |
isValidFloat(String value,
int decimals)
Tell whether a float string is in valid format, according with
a number of fraction digits.
|
static Double |
strToDouble(String text,
int decimals)
Parses a string to produce a Double with a number of fraction
digits.
|
static Float |
strToFloat(String text,
int decimals)
Parses a string to produce a Float with a number of fraction
digits.
|
public static String doubleToStr(double origin, int decimals)
origin
- double to formatdecimals
- number of fraction digitspublic static String doubleToStr(Number origin, int decimals)
origin
- Number to formatdecimals
- number of fraction digitspublic static Double strToDouble(String text, int decimals)
text
- string to parsedecimals
- number of fraction digitspublic static Float strToFloat(String text, int decimals)
text
- string to parsedecimals
- number of fraction digitspublic static boolean isValidDouble(String value, int decimals)
value
- the double string to be testeddecimals
- number of decimalspublic static boolean isValidFloat(String value, int decimals)
value
- the float string to be testeddecimals
- number of decimalsCopyright © 2012–2017 JBoss by Red Hat. All rights reserved.