public class DecimalType extends NumericType
NumericType which guarantees fixed number of decimal
places. In particular, a decimal with zero scale is an integer.| Constructor and Description |
|---|
DecimalType(int precision,
int scale)
Creates a decimal type with precision and scale.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
int |
getPrecision()
Returns the maximum number of decimal digits which a value of
this type can have.
|
int |
getScale()
Returns the number of digits to the right of the decimal point.
|
isInstancecomputeCommonType, getArity, getDimension, getHierarchy, getLevel, hashCode, toString, usesDimension, usesHierarchypublic DecimalType(int precision,
int scale)
Examples:
The largest value is 10 ^ (precision - scale). Hence the largest
DECIMAL(5, -3) value is 10 ^ 8.
precision - Maximum number of decimal digits which a value of
this type can have.
Must be greater than zero.
Use Integer.MAX_VALUE if the precision is unbounded.scale - Number of digits to the right of the decimal point.public int getPrecision()
public int getScale()
public boolean equals(Object obj)
equals in class NumericTypeCopyright © 2020 Hitachi Vantara. All rights reserved.