public class NumberPrecisionReducer
extends java.lang.Object
Constructor and Description |
---|
NumberPrecisionReducer() |
NumberPrecisionReducer(double scaleFactor)
A negative value for scaleFactor indicates
that the precision reduction will eliminate significant digits
to the left of the decimal point.
|
Modifier and Type | Method and Description |
---|---|
double |
reducePrecision(double d) |
static double |
scaleFactorForDecimalPlaces(int decimalPlaces)
Computes the scale factor for a given number of decimal places.
|
void |
setScaleFactor(double scaleFactor) |
public NumberPrecisionReducer()
public NumberPrecisionReducer(double scaleFactor)
scaleFactor
- public static double scaleFactorForDecimalPlaces(int decimalPlaces)
decimalPlaces
- public void setScaleFactor(double scaleFactor)
public double reducePrecision(double d)