|
Buglet - buglet.sourceforge.org | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.buglet.util.NumberUtil
Converts the given number to a String, padding with extra decimals where required.
Constructor Summary | |
NumberUtil()
|
Method Summary | |
static java.lang.String |
commafy(java.lang.String val)
|
static java.lang.String |
commafy(java.lang.String val,
java.lang.String separator)
generate a string representation of a number and place commas in between. |
static java.lang.String |
forDisplay(double value,
int decimalPlaces)
Converts a double to a String, adds the given number of decimalPlaces. |
static java.lang.String |
forDisplay(float value,
int decimalPlaces)
Converts a float to a String, adds the given number of decimalPlaces. |
static java.lang.String |
forDisplay(java.lang.Float value,
int decimalPlaces)
|
static java.lang.String |
forDisplay(int value,
int decimalPlaces)
Converts an int to a String, adds the given number of decimalPlaces. |
static java.lang.String |
forDisplay(long value,
int decimalPlaces)
Converts a long to a String, adds the given number of decimalPlaces. |
static java.lang.String |
forDisplay(java.lang.String valueString,
int decimalPlaces)
Converts the valueString to a String padded with the given number of decimalPlaces. |
static java.lang.String |
leftSide(java.lang.String val)
Returns the part of the String left of the decimal place. |
static void |
main(java.lang.String[] args)
main class used for testing the util |
static int |
minNotNegative(int one,
int two)
Returns the non-negative minimum of two numbers min(-1,2) -> 2 min(3,4) -> 3 |
static java.lang.String |
rightSide(java.lang.String val)
Returns the part of the String right of the decimal place |
static java.lang.String |
roundedString(double val)
|
static java.lang.String |
trunctuate(java.lang.String val,
int decimalPlaces)
Returns the String, trunctuated to the given number of decimal places. |
Methods inherited from class java.lang.Object |
|
Constructor Detail |
public NumberUtil()
Method Detail |
public static java.lang.String forDisplay(int value, int decimalPlaces)
value
- decimalPlaces
- public static java.lang.String forDisplay(long value, int decimalPlaces)
value
- decimalPlaces
- public static java.lang.String forDisplay(float value, int decimalPlaces)
value
- decimalPlaces
- public static java.lang.String forDisplay(java.lang.Float value, int decimalPlaces)
public static java.lang.String forDisplay(double value, int decimalPlaces)
value
- decimalPlaces
- public static java.lang.String forDisplay(java.lang.String valueString, int decimalPlaces)
valueString
- decimalPlaces
- public static java.lang.String leftSide(java.lang.String val)
val
- public static java.lang.String commafy(java.lang.String val)
public static java.lang.String commafy(java.lang.String val, java.lang.String separator)
public static java.lang.String rightSide(java.lang.String val)
val
- public static java.lang.String trunctuate(java.lang.String val, int decimalPlaces)
val
- decimalPlaces
- public static int minNotNegative(int one, int two)
one
- two
- public static java.lang.String roundedString(double val)
public static void main(java.lang.String[] args)
args
-
|
Buglet - buglet.sourceforge.org | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |