|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.ctdp.rfdynhud.util.NumberUtil
public class NumberUtil
The NumberUtil
keeps static methods to format numbers.
Constructor Summary | |
---|---|
NumberUtil()
|
Method Summary | |
---|---|
static java.lang.String |
delta(float i)
|
static java.lang.String |
delta(int i)
|
static java.lang.String |
formatFloat(float f,
int numDecPlaces,
boolean forceFractions)
Formats the given float to a String with the specified number of decimal places. |
static java.lang.String |
formatFloat(float f,
int numDecPlaces,
boolean forceFractions,
boolean forceSign)
Formats the given float to a String with the specified number of decimal places. |
static java.lang.String |
pad2(int number)
|
static int |
roundUpPower2(int v)
Gets the next greater power-of-two for the given number. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NumberUtil()
Method Detail |
---|
public static final java.lang.String pad2(int number)
public static final java.lang.String formatFloat(float f, int numDecPlaces, boolean forceFractions, boolean forceSign)
f
- the number to formatnumDecPlaces
- the maximum number of decimal placesforceFractions
- always format with maximum number of fractions?forceSign
- always show the sign?
public static final java.lang.String formatFloat(float f, int numDecPlaces, boolean forceFractions)
f
- the number to formatnumDecPlaces
- the maximum number of decimal placesforceFractions
- always format with maximum number of fractions?
public static final int roundUpPower2(int v)
v
- the value to round up
public static final java.lang.String delta(int i)
public static final java.lang.String delta(float i)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |