@HiveDecimalVersionV2 public String toFormatString(int formatScale, byte[] scratchBuffer) { return fastToFormatString( formatScale, scratchBuffer); }
/** * Return a string representation of the decimal using the specified scale. * <p> * This method is designed to ALWAYS SUCCEED (unless the newScale parameter is out of range). * <p> * Is does the equivalent of a setScale(int newScale). So, more than 38 digits may be returned. * See that method for more details on how this can happen. * <p> * @param formatScale The number of digits after the decimal point * @return The scaled decimal representation string representation. */ @HiveDecimalVersionV1 public String toFormatString(int formatScale) { return fastToFormatString( formatScale); }
@HiveDecimalVersionV2 public String toString( byte[] scratchBuffer) { if (fastSerializationScale() != -1) { // Use the serialization scale and format the string with trailing zeroes (or // round the decimal) if necessary. return fastToFormatString( fastSerializationScale(), scratchBuffer); } else { return fastToString(scratchBuffer); } }
/** * Return a string representation of the decimal. * <p> * It is the equivalent of calling bigDecimalValue().toPlainString -- it does not add exponent * notation -- but is much faster. * <p> * NOTE: If setScale(int serializationScale) was used to create the decimal object, then trailing * fractional digits will be added to display to the serializationScale. Or, the display may * get rounded. See the comments for that method. * */ @HiveDecimalVersionV1 @Override public String toString() { if (fastSerializationScale() != -1) { // Use the serialization scale and format the string with trailing zeroes (or // round the decimal) if necessary. return fastToFormatString(fastSerializationScale()); } else { return fastToString(); } }
@HiveDecimalVersionV2 public String toFormatString(int formatScale, byte[] scratchBuffer) { return fastToFormatString( formatScale, scratchBuffer); }
/** * Return a string representation of the decimal using the specified scale. * <p> * This method is designed to ALWAYS SUCCEED (unless the newScale parameter is out of range). * <p> * Is does the equivalent of a setScale(int newScale). So, more than 38 digits may be returned. * See that method for more details on how this can happen. * <p> * @param formatScale The number of digits after the decimal point * @return The scaled decimal representation string representation. */ @HiveDecimalVersionV1 public String toFormatString(int formatScale) { return fastToFormatString( formatScale); }
@HiveDecimalVersionV2 public String toString( byte[] scratchBuffer) { if (fastSerializationScale() != -1) { // Use the serialization scale and format the string with trailing zeroes (or // round the decimal) if necessary. return fastToFormatString( fastSerializationScale(), scratchBuffer); } else { return fastToString(scratchBuffer); } }
/** * Return a string representation of the decimal. * <p> * It is the equivalent of calling bigDecimalValue().toPlainString -- it does not add exponent * notation -- but is much faster. * <p> * NOTE: If setScale(int serializationScale) was used to create the decimal object, then trailing * fractional digits will be added to display to the serializationScale. Or, the display may * get rounded. See the comments for that method. * */ @HiveDecimalVersionV1 @Override public String toString() { if (fastSerializationScale() != -1) { // Use the serialization scale and format the string with trailing zeroes (or // round the decimal) if necessary. return fastToFormatString(fastSerializationScale()); } else { return fastToString(); } }