public class NumberFormat extends DisplayFormat
integer
, int64
and decimal
variables.Modifier and Type | Class and Description |
---|---|
private class |
NumberFormat.NumberBuf
Internal form of a number.
|
DisplayFormat.Presentation
Modifier and Type | Field and Description |
---|---|
private boolean |
clearLeadingZeros
Clear leading zeros for Z format.
|
private static decimal |
DECIMALZERO
Allows quick comparisons with zero.
|
protected int |
fmtFractDigitsCount
Number of '9' chars after period.
|
protected int |
fmtFractSharedCount
Number of '<' chars.
|
protected boolean |
fmtHavePeriod
Is decimal period present?
|
protected int |
fmtIntDigitsCount
Number of 'Z' or '9' or '*' chars before period.
|
protected int |
fmtIntSharedCount
Number of '>' chars.
|
protected int |
fmtIntZerosCount
Number of '9' chars before period.
|
protected NumberType.FormatSpec |
fs
Stores parsed format string metrics.
|
private boolean |
rightAligned
Control format alignment.
|
private boolean |
splitFormat
Complex format with split alignment.
|
editableSource, fmtScreenWidth
Constructor and Description |
---|
NumberFormat(java.lang.String pformat)
Constructs a number (decimal, int64 or integer) format from a Progress
compatible format string.
|
Modifier and Type | Method and Description |
---|---|
DisplayFormat.Presentation |
clear(DisplayFormat.Presentation pres)
Returns a new presentation instance with a default initialized insert
mode and cursor position.
|
DisplayFormat.Presentation |
fromVar(BaseDataType var)
Initializes a presentation for variable's value.
|
boolean |
isRightPositioning()
Indicates if the screen value or a column's title could be formatted
with trimming from the left and right alignment based on this format.
|
boolean |
isSplitFormat()
Indicates if current output is split format
|
private int |
signSize(int signType)
Calculates the number of characters in a sign representation.
|
clear, formatScreenValue, generateQuestions, generateSpaces, getFormatDef, getScreenWidth, instanceOfType, instanceOfType, instanceOfType, isFormatCheck, isZapSupported, setEditableSource
private static final decimal DECIMALZERO
protected NumberType.FormatSpec fs
protected boolean fmtHavePeriod
protected int fmtIntSharedCount
protected int fmtIntDigitsCount
protected int fmtIntZerosCount
protected int fmtFractDigitsCount
protected int fmtFractSharedCount
private boolean rightAligned
private boolean splitFormat
private boolean clearLeadingZeros
public NumberFormat(java.lang.String pformat) throws DisplayFormatParsingException
pformat
- Progress format string.DisplayFormatParsingException
- Format string is invalid.public boolean isRightPositioning()
This value only notes if this format supports such trimming/alignment but it doesn't specify if it should be applied in every case (which may be a configuration option for a given caller).
isRightPositioning
in class DisplayFormat
true
.public boolean isSplitFormat()
public DisplayFormat.Presentation clear(DisplayFormat.Presentation pres)
clear
in class DisplayFormat
pres
- A Presentation instance which was constructed by this format.
May be null
. This presentation instance is not
changed in this method.public DisplayFormat.Presentation fromVar(BaseDataType var) throws DisplayFormatCheckException
fromVar
in class DisplayFormat
var
- Variable which should be compatible with format.DisplayFormatCheckException
- Variable's value is incompatible with format.private int signSize(int signType)
signType
- encoding of sign type