Package mondrian.util
Class MondrianFloatingDecimal
- java.lang.Object
-
- mondrian.util.MondrianFloatingDecimal
-
class MondrianFloatingDecimal extends Object
Representation of a number as a list of digits.- Author:
- tkafalas
-
-
Field Summary
Fields Modifier and Type Field Description (package private) intdecExponent(package private) char[]digits(package private) booleanisExceptional(package private) booleanisNegative(package private) intnDigits
-
Constructor Summary
Constructors Constructor Description MondrianFloatingDecimal(double d)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intformatExponent(char[] result, int i, boolean expSign, int minExpDigits)AppendsdecExponentto result string.StringtoString()
-
-
-
Method Detail
-
formatExponent
public int formatExponent(char[] result, int i, boolean expSign, int minExpDigits)AppendsdecExponentto result string. Returns i plus the number of chars written.Implementation may assume that exponent has 3 or fewer digits.
For example, given
decExponent= 2,formatExponent(result, 5, true, 2)will write '0' into result[5] and '2' into result[6] and return 7.- Parameters:
result- Result bufferi- Initial offset into result bufferexpSign- Whether to print a '+' sign if exponent is positive (always prints '-' if negative)minExpDigits- Minimum number of digits to write- Returns:
- Offset into result buffer after writing chars
-
-