/** * Retrieve (in string format) from this field. * @return The string of the recriprical of this field's value. */ public String getString() { String string = Constants.BLANK; NumberField numberField = (NumberField)this.getField(); if (this.getNextConverter().getLength() != 0) { double dValue = this.getValue(); if (dValue != 0) dValue = 1 / dValue; if (m_mfRecip == null) m_mfRecip = NumberFormat.getInstance(); m_mfRecip.setMinimumFractionDigits(numberField.getScale()); m_mfRecip.setMaximumFractionDigits(numberField.getScale()); string = m_mfRecip.format(dValue); } return string; } /**
/** * Retrieve (in string format) from this field. * @return The string of the recriprical of this field's value. */ public String getString() { String string = Constants.BLANK; NumberField numberField = (NumberField)this.getField(); if (this.getNextConverter().getLength() != 0) { double dValue = this.getValue(); if (dValue != 0) dValue = 1 / dValue; if (m_mfRecip == null) m_mfRecip = NumberFormat.getInstance(); m_mfRecip.setMinimumFractionDigits(numberField.getScale()); m_mfRecip.setMaximumFractionDigits(numberField.getScale()); string = m_mfRecip.format(dValue); } return string; } /**
/** * Retrieve (in string format) from this field. * @return The string of the recriprical of this field's value. */ public String getString() { String string = Constants.BLANK; NumberField numberField = (NumberField)this.getField(); if (this.getNextConverter().getLength() != 0) { double dValue = this.getValue(); if (dValue != 0) dValue = 1 / dValue; if (m_mfRecip == null) m_mfRecip = NumberFormat.getInstance(); m_mfRecip.setMinimumFractionDigits(numberField.getScale()); m_mfRecip.setMaximumFractionDigits(numberField.getScale()); string = m_mfRecip.format(dValue); } return string; } /**
/** * Convert and move string to this field. * Get the recriprical of this string and set the string. * @param bState the state to set the data to. * @param bDisplayOption Display the data on the screen if true. * @param iMoveMode INIT, SCREEN, or READ move mode. * @return The error code (or NORMAL_RETURN). */ public int setString( String strField, boolean bDisplayOption, int iMoveMode) { NumberField numberField = (NumberField)this.getNextConverter(); int iErrorCode = super.setString(strField, DBConstants.DONT_DISPLAY, iMoveMode); if (strField.length() == 0) numberField.displayField(); // Special Case (because we return immediately) if ((iErrorCode != DBConstants.NORMAL_RETURN) || strField.length() == 0) return iErrorCode; double doubleValue = this.getValue(); if (doubleValue != 0) doubleValue = 1 / doubleValue; iErrorCode = this.setValue(doubleValue, bDisplayOption, DBConstants.SCREEN_MOVE); return iErrorCode; } }
/** * Convert and move string to this field. * Get the recriprical of this string and set the string. * @param bState the state to set the data to. * @param bDisplayOption Display the data on the screen if true. * @param iMoveMode INIT, SCREEN, or READ move mode. * @return The error code (or NORMAL_RETURN). */ public int setString( String strField, boolean bDisplayOption, int iMoveMode) { NumberField numberField = (NumberField)this.getNextConverter(); int iErrorCode = super.setString(strField, DBConstants.DONT_DISPLAY, iMoveMode); if (strField.length() == 0) numberField.displayField(); // Special Case (because we return immediately) if ((iErrorCode != DBConstants.NORMAL_RETURN) || strField.length() == 0) return iErrorCode; double doubleValue = this.getValue(); if (doubleValue != 0) doubleValue = 1 / doubleValue; iErrorCode = this.setValue(doubleValue, bDisplayOption, DBConstants.SCREEN_MOVE); return iErrorCode; } }
/** * Convert and move string to this field. * Get the recriprical of this string and set the string. * @param bState the state to set the data to. * @param bDisplayOption Display the data on the screen if true. * @param iMoveMode INIT, SCREEN, or READ move mode. * @return The error code (or NORMAL_RETURN). */ public int setString( String strField, boolean bDisplayOption, int iMoveMode) { NumberField numberField = (NumberField)this.getNextConverter(); int iErrorCode = super.setString(strField, DBConstants.DONT_DISPLAY, iMoveMode); if (strField.length() == 0) numberField.displayField(); // Special Case (because we return immediately) if ((iErrorCode != DBConstants.NORMAL_RETURN) || strField.length() == 0) return iErrorCode; double doubleValue = this.getValue(); if (doubleValue != 0) doubleValue = 1 / doubleValue; iErrorCode = this.setValue(doubleValue, bDisplayOption, DBConstants.SCREEN_MOVE); return iErrorCode; } }