|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sap.ip.me.api.smartsync.FixedDecimal
A FixedDecimal is an immutable, arbitrary-precision signed decimal number.
It consists of an arbitrary precision unscaled integer value and a
non-negative 32-bit integer scale, which represents the number of digits to
the right of the decimal point. The number represented by the FixedDecimal
is (unscaledValue/10scale). FixedDecimal provides operations for basic
arithmetic, comparison, and format conversion.
The string represenation of a FixedDecimal has the following parts:
The string must contain at least one digit in either the integer or the fraction part.
- an optional sign ('+' or '-')
- the integer part (left side of the decimal point)
- a decimal or radix point
- the fraction part (right side of the decimal point)
Field Summary | |
static long |
serialVersionUID
Deprecated. The serial version ID |
Constructor Summary | |
FixedDecimal(java.lang.String iStringVal,
int iLen,
int iDec)
Deprecated. Constructs a FixedDecimal instance with the specified String representation of a decimal number, length and decimal digit length. |
|
FixedDecimal(java.lang.String iFormattedVal,
java.util.Locale local,
int iLen,
int iDec)
Deprecated. Constructs a FixedDecimal instance with the specified String representation of a decimal number, the locale of the string representation, length and decimal digit length. |
Method Summary | |
FixedDecimal |
add(FixedDecimal iVal)
Deprecated. Returns the sum of this FixedDecimal and the specified FixedDecimal parameter. |
java.math.BigDecimal |
bigDecimalValue()
Deprecated. Return the BigDecimal value of this FixedDecimal. |
int |
compareTo(FixedDecimal iVal)
Deprecated. Compares this FixedDecimal with the specified FixedDecimal regardless of their total lengths nor decimal digit lengths. |
FixedDecimal |
copy()
Deprecated. Clones this FixedDecimal instance |
FixedDecimal |
divide(FixedDecimal iVal)
Deprecated. Returns the quotient when this FixedDecimal is divided by the specified FixedDecimal value. |
double |
doubleValue()
Deprecated. Returns the double value of this FixedDecimal. |
boolean |
equals(java.lang.Object o)
Deprecated. Compares two Objects for equality. |
float |
floatValue()
Deprecated. Returns the float value of this FixedDecimal. |
java.lang.String |
formattedString(java.util.Locale local)
Deprecated. Converts this FixedDecimal to a formatted string of the specified Locale. |
int |
getDecimals()
Deprecated. Returns the decimals length |
int |
getLength()
Deprecated. Returns the total fixed length. |
int |
hashCode()
Deprecated. Returns the hash code value of this FixedDecimal. |
FixedDecimal |
multiply(FixedDecimal iVal)
Deprecated. Returns the product of this FixedDecimal and the specified FixedDecimal parameter. |
FixedDecimal |
negate()
Deprecated. Returns the negative value of this FixedDecimal. |
java.lang.String |
stringValue()
Deprecated. Returns the String representation of this FixedDecimal. |
java.lang.String |
toString()
Deprecated. Returns the String representation of this FixedDecimal |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final long serialVersionUID
Constructor Detail |
public FixedDecimal(java.lang.String iStringVal, int iLen, int iDec) throws java.lang.NumberFormatException
For example:
FixedDecimal orderPrice = new FixedDecimal("-123456.22", 16, 2);
iStringVal
- decimal representation in StringiLen
- maximum length excluding the decimal
point and signiDec
- fractional part length
java.lang.NumberFormatException
- is thrown if the specified decimal string
is null or is an invalid numerical string representation.public FixedDecimal(java.lang.String iFormattedVal, java.util.Locale local, int iLen, int iDec) throws java.lang.NumberFormatException
For example:
FixedDecimal orderPrice = new FixedDecimal("-123.456,22",Locale.GERMANY, 16, 2);
iFormattedVal
- the formatted decimal stringlocal
- the Locale to which the format of the
specified decimal representation is basediLen
- maximum length excluding the decimal
point and signiDec
- fractional part length
java.lang.NumberFormatException
- is thrown if the specified decimal string
is null or is an invalid numerical string representation.Method Detail |
public FixedDecimal add(FixedDecimal iVal)
iVal
- the FixedDecimal to be added to this FixedDecimal
public FixedDecimal multiply(FixedDecimal iVal)
iVal
- the muliplier FixedDecimal
public FixedDecimal divide(FixedDecimal iVal)
iVal
- the divisor FixedDecimal
public FixedDecimal negate()
public int compareTo(FixedDecimal iVal)
iVal
- the FixedDecimal instance to be compared to this intance
public java.lang.String toString()
public java.lang.String stringValue()
public FixedDecimal copy()
public java.lang.String formattedString(java.util.Locale local)
Locale.US - "1,100.23" Locale.GERMANY - "1.100,23"
local
- the local to which the format ot te string representation will be based.
public double doubleValue()
public float floatValue()
public java.math.BigDecimal bigDecimalValue()
public int getLength()
public int getDecimals()
public boolean equals(java.lang.Object o)
o
- the object to be compared to this object
public int hashCode()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |